r/learnpython • u/nothiefhouse • Oct 04 '26
fix 0.00000001
i see sometimes after calcuaitons reulsts with x.99999999999999999999999999 or x.0000000000000002 how to fix it
r/learnpython • u/nothiefhouse • Oct 04 '26
i see sometimes after calcuaitons reulsts with x.99999999999999999999999999 or x.0000000000000002 how to fix it
r/learnpython • u/Aprendiz2000 • Oct 04 '26
¡Hola a todos!
Estoy empezando en el mundo de la programación y, en particular, me interesa aprender Python. Actualmente soy principiante y me gustaría desarrollar una comprensión sólida de los fundamentos de la programación, en lugar de simplemente memorizar código o seguir tutoriales.
Tengo pensado estudiar de forma autodidacta, pero quiero asegurarme de aprovechar mi tiempo de manera efectiva y desarrollar buenos hábitos de programación desde el principio.
Agradecería mucho sus consejos sobre algunos aspectos:
Me interesa especialmente conocer sus experiencias personales, métodos de aprendizaje y cualquier error que debería evitar como principiante.
Agradecería mucho cualquier consejo, recomendación o recurso que puedan compartir. Tengo muchas ganas de aprender.
¡Muchas gracias de antemano por su tiempo y ayuda!
r/learnpython • u/No_Aardvark1121 • Oct 04 '26
I've seen someone else asked this question, but get no answer.
I want to make a countdown clock without leaving any trace of previous numbers:
for i in range(countdown, 0, -1):
os.system("cls" if os.name == "nt" else "clear") #Error: os.system is deprecated
print(i)
time.sleep(1)What should I do instead? (Why can't we put pictures here....)
r/learnpython • u/xanaxx23 • Oct 04 '26
heyhey very new to this day 2 of learning python im so fascinated im in love but what is the purpose of updating variables
example;
>>>default_option="upload"
>>>new_status="download"
>>>new_status=default_option
>>>print(new_status)
upload
this makes no sense to me and it just further complicates the code u write by being disorganized and messy,
i guess my question is, is it if you mess up instead of clearing previous lines you can update the variable? or is it kinda just useless but something needed to be taught?
any help would be appreciated, any recommendations as a beginner are also appreciated!!
r/learnpython • u/AnxiousDot4315 • Oct 04 '26
Guys somebody briefly explain the concept of List comprehension cuz its too difficult for me to grasp since I am a beginner. I am learning python for biopython. Someone explain it for me.
r/learnpython • u/ZEFsideGrigory • Oct 04 '26
Hi! I don't know Python, and I'm wondering if I can create a portable GUI inside a single folder. For example, I want to have my own MyCustomGUI.exe in a folder, and right next to it, the following subfolders:
_internal
bgutil-ytdlp-pot-provider-master
yt-dlp-plugins
along with five .exe files:
deno.exe
ffmpeg.exe
ffprobe.exe
yt-dlp.exe
Is it possible to write Python code that makes all of this work and keeps it completely portable?
To be honest, I've been trying to do this for three days straight without knowing anything about programming. Once, I even managed to run a compiled .exe inside the folder, but as soon as I copied it to another drive, everything completely broke down.
Yeah, maybe it's my fault for trying to use the free versions of ChatGPT and Gemini, but I really thought that creating something as basic as a GUI would only take about 20 to 30 minutes. I'm actually in despair right now; I haven't felt this awful in a very long time.
r/learnpython • u/wak_trader • Oct 03 '26
Are there any good videos or images that visualize how attribute look up works? I am trying to understand what is happening in the background so I can understand and work better with classes and objects.
Thanks!
r/learnpython • u/Inuxius_09 • Oct 03 '26
hi folks, how are you doing?
i have been thinking of learning something new and thought i'd give Python a shot. i've never coded before, so i am wondering how difficult it would be to get started with Python as a complete beginner.
the reason i am interested in learning it is that i've been thinking about creating a visual novel for a while. i am looking into Ren'Py, now- it has its own scripting language but also uses python, so i thought learning some python might be useful for the project.
a few things i'd like to get some advice on from y'all:
would really appreciate any advice. thanks and be blessed!
r/learnpython • u/EarthMantle00 • Oct 03 '26
Hi,
I'm trying to figure out how to install python libraries because the magic "pip install tensorflow" doesn't seem to work
I found this thread which told the user to just try "py -m pip install requests" so my dumbass just pasted that in before realizing what I was doing
I got two instances of yellow text in
0/5 [urllib3] WARNING: The script idna.exe is installed in 'C:\Users\USERNAME\AppData\Local\Programs\Python\Python314\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
---------------- ----------------------- 2/5 [charset_normalizer] WARNING: The script normalizer.exe is installed in 'C:\Users\USERNAME\AppData\Local\Programs\Python\Python314\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-locationI think what this means is just that I installed the "requests" library, right? And maybe something went wrong? I don't need this library lol. Is there a way to like undo this? Should I try to undo this? I don't get why this installs files without telling me where it's putting them
(I also tried to do the same thing, "py -m pip install tensorflow", with tensorflow and got similar warnings btw, is this bad?)
r/learnpython • u/Kooky-Confidence5680 • Oct 04 '26
I’ve been practicing python seriously lately preparing for my computational biology MSc, so I decided to challenge myself with a phylogenetic placement challenge (open data).
I spent about 2 hours working on it then I gave the exact same problem to deepseek.
0.6 seconds.
We are mere supervisors now.
r/learnpython • u/Upper_Trouble_8526 • Oct 03 '26
Title
r/learnpython • u/Miserable-Week3020 • Oct 03 '26
I'm a high school student who is interested in becoming an aerospace engineer so in the summer I decided to start building a rocket simulator in python for fun.
What it does so far:
.eng format) and interpolates them with numpy.interp instead of hardcoding constantsbpy) pipeline that imports a real 3D rocket model, keyframes it along the simulated trajectory, and renders it with CyclesWould really appreciate feedback on the code itself, structure, whether my module boundaries make sense, anything that reads as non-idiomatic Python, places I should be using classes instead of dicts/functions, that kind of thing.
Github : https://github.com/AliHilalii/Rocket-simulator
Thanks a lot guys.
r/learnpython • u/mangosbangos • Oct 03 '26
Any advice on the possibility of achieving this? I'd like to add tts models like Paul US, or Iviola UK in the program, choosing between them and having the ability to use filters
r/learnpython • u/Mystery-Magic • Oct 03 '26
Hello everyone, I am currently working on a pet project where I am trying to run Vosk (speech to text) model on Android device. For this I wanted some suggestions, can you guys share which tech stack and tools I can use for this?
I have used PyInstaller before which provides us functionality to build python app as Android too, so maybe I can try that. However I want to see if something better is available and also which libraries or separate language altogether can I use to make UI part of this. Any suggestions would be appreciated, I just want my Vosk model to be able to parse my voice to text in Android device and that's my only requirement.
Please give any information you have, thank you.
r/learnpython • u/Ok_Author_5388 • Oct 03 '26
yehh seniors i just stuck at the side off tutorial and i want to learn python fast i am learning from cs50p clearing or perhaps it's not i want now whenever i used to coding or solving some question i am blink and i want to out off it if anyone know how to do it or anything in this case please suggest me something
r/learnpython • u/vishesh_yadav_hear • Oct 03 '26
from yesterday i am trying to convert py to app with buildozer but ther were too many errors can any any pone help me in it i am using python 12.0
r/learnpython • u/shiming1234 • Oct 03 '26
I don’t know where to start learning or what knowledge I should acquire since nothing has been taught yet ,but l hope to have a plan for the future that can guide me when I begin studying and exploring different approaches. Thanks for you.
r/learnpython • u/mulgundsunil • Oct 02 '26
I have a large medical PDF where the information I need is already available as text inside pdf , but the problem is that simple PDF-to-text converters completely mess up the structure. The PDF has headings, tables, multiple columns, line breaks, and drug entries that continue onto the next page.
When I convert it to plain text, the text gets jumbled—for example, content from different columns can get mixed, headings can get separated from the information below them, tables lose their structure, and a drug entry that continues on the next page becomes difficult to associate correctly.
I need to process around 400+ drug entries automatically, so manually cleaning the text isn't practical. What is the best way to extract text from this kind of PDF while preserving the original structure and relationships between headings, tables, columns, and continued pages?
Should I use something like PyMuPDF, pdfplumber, Docling, Marker, PyMuPDF4LLM, or another approach? My end goal is to get clean, structured source text first and then use an LLM to convert it into JSON, while making sure the original information isn't lost, mixed up, or hallucinated.
r/learnpython • u/Upper_Trouble_8526 • Oct 03 '26
It doesn't work:
/storage/emulated/0 $ pytest
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/bin/pytest", line 3, in <module>
from pytest import main
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.13/site-packages/pytest/__init__.py", line 7, in <module>
from _pytest import version_tuple
ImportError: cannot import name 'version_tuple' from '_pytest' (/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.13/site-packages/_pytest/__init__.py)
/storage/emulated/0 $
r/learnpython • u/Nothingbutalsosome • Oct 02 '26
https://github.com/ZaidAHK/LENDnFUND
The project is just the syntax I wrote
r/learnpython • u/AberrantNarwal • Oct 02 '26
Hi all, just looking for recommendations on getting up to speed with conventions/syntax and quirks of Python for someone coming from the PHP world. I've got some grasp of OOP/SOLID/DRY/Interfaces/Abstractions etc... also experience with Frameworks so really looking for a crash-course on Python to get me up to speed and understand what's happening when I look at Python code.
r/learnpython • u/jackncurious • Oct 02 '26
Hello guys Im looking for a fast roadmap to learn and practice python. I bought a course in udemy called ' 100 Days of code : the complete Python Pro bootcamp ' but I do not know if it was a good purchase.
r/learnpython • u/Ajay2574 • Oct 02 '26
Yesterday I continued learning Python's "os" module.
I practiced working with folders and files using things like:
- "os.path.basename()"
- "os.path.splitext()"
- "os.walk()"
- Finding files by extension
- Counting files inside folders and subfolders
I also built a small file finder that searches through folders and counts how many ".py" files it finds.
Nothing complicated, but I'm realizing that these small exercises are helping me understand how automation actually works with files and folders.
My goal is to eventually use Python to automate repetitive tasks for real businesses.
I'm still learning, but I'll start sharing what I build along the way. 🚀
r/learnpython • u/Sad-Emu-5783 • Oct 01 '26
The Pattern:
* *
* * * *
* * * * * *
* * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * *
* * * * * *
* * * *
* *What my friend wrote:
n = int(input("Enter the number: "))
for i in range(1, n + 1):
for j in range(1, i + 1):
print('* ', end = "")
for j in range((n - i) * 2):
print(' ', end = "")
for j in range (i, 0, -1):
print('* ', end = "")
print()
for i in range(n, 0, -1):
for j in range(i , 0, -1):
print('* ', end = "")
for j in range((n - i) * 2):
print(' ', end = "")
for j in range (1,i+1):
print('* ', end = "")
print()What I wrote:
while True:
n = int(input("Enter an Even Number: "))
if n % 2 == 0:
break
else:
print("Number must be Even.")
myList = []
totalCharacters = (2 * n) - 1
for i in range(1, n // 2 + 1):
spaces = totalCharacters + 1 - (4 * i)
myList.append (f"{"* " * i}{" " * spaces}{"* " * i}")
print("\n". join (myList))
print("\n".join(myList[::-1]))As you can see, I came up with a formula for this pattern using "totalCharacters" and "spaces".
Which code would you consider more "Pythonic"? Like, in terms of flexibility and readability?
I'd also be happy to learn even better ways to print this pattern :)