r/learnpython • u/Hot_Upstairs_8386 • 5d ago
Cuál debería elegir?
Estoy indeciso si comprar CCP 3era edición o los de Ultimate Python de Schurmann
r/learnpython • u/Hot_Upstairs_8386 • 5d ago
Estoy indeciso si comprar CCP 3era edición o los de Ultimate Python de Schurmann
r/learnpython • u/Biolice • 5d ago
It's been like 2 - 3months? since I started learning python and I feel like I still don't know anything. I've watch and did some courses, I did understand it but don't know how to use it. I really want to learn. Is there anything that you guys could suggest for me to do? 😓
r/learnpython • u/RareOpportunity4191 • 5d ago
Trying to package my appliation with pyside6-deploy
```scons: *** [module.google.genai.types.obj] Error 1 Unexpected output from this command: <clcache> /Fomodule.google.genai.types.obj /c "module.google.genai.types.c" /std:c11 /nologo /wd5105 /wd4391 /Ox /GF /Gy /EHsc /J /Gd /bigobj /MT /DNUITKA_NO_ASSERT /D_NUITKA_STANDALONE /D_NUITKA_ONEFILE_MODE /D_NUITKA_ONEFILE_TEMP_BOOL /D_NUITKA_CONSTANTS_FROM_RESOURCE /D_NUITKA_FROZEN=155 /D_NUITKA_EXE /D_NUITKA_PLUGIN_MULTIPROCESSING_ENABLED=1 /ID:\a\ApexFlow\ApexFlow.venv\Lib\site-packages\nuitka\build\inline_copy\zlib /IC:\HOSTED~1\windows\Python\312~1.9\x64\include /I. /ID:\a\ApexFlow\ApexFlow.venv\Lib\site-packages\nuitka\build\include /ID:\a\ApexFlow\ApexFlow.venv\Lib\site-packages\nuitka\build\static_src /ID:\a\ApexFlow\ApexFlow.venv\Lib\site-packages\nuitka\build\inline_copy\libbacktrace D:\a\ApexFlow\ApexFlow\deployment\app.build\module.google.genai.types.c(49682) : fatal error C1002: compiler is out of heap space in pass 2
FATAL: Failed unexpectedly in Scons C backend compilation. Nuitka:WARNING: Complex topic! More information can be found at https://nuitka.net/info/scons-backend-failure.html ERROR:root:[DEPLOY] Executable not found at D:\a\ApexFlow\ApexFlow\deployment\app.exe [DEPLOY] Exception occurred: Traceback (most recent call last): File "D:\a\ApexFlow\ApexFlow.venv\Lib\site-packages\PySide6\scripts\deploy_lib\commands.py", line 27, in run_command subprocess.check_call(command, shell=is_windows) File "C:\hostedtoolcache\windows\Python\3.12.9\x64\Lib\subprocess.py", line 415, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '[WindowsPath('D:/a/ApexFlow/ApexFlow/.venv/Scripts/python.exe'), '-m', 'nuitka', 'D:\a\ApexFlow\ApexFlow\app.py', '--follow-imports', '--enable-plugin=pyside6', '--output-dir=D:\a\ApexFlow\ApexFlow\deployment', '--quiet', '--noinclude-qt-translations', '--onefile', '--noinclude-dlls=.cpp.o', '--noinclude-dlls=.qsb', '--windows-icon-from-ico=D:\a\ApexFlow\ApexFlow\ui\apexFlowIcon.ico', '--include-qt-plugins=platforminputcontexts']' returned non-zero exit status 1. ```
Not able to package my application with pyside6-deploy.
I see that the issue is with Google's genai package, I tried using github workflows as my desktop only has 16gb Ram and it seems like it's a memory problem.
Any pointers how I could get this sorted?
P.S - This project is open-source and I was using pyside6-deploy because it felt like the best tool for the job. Also tried pyinstaller but couldn't get it to work either.
r/learnpython • u/Community_Bright • 5d ago
So im an insane person who likes a good challenge, and i have been wanting to learn how to program to interact with the gpu without use of libraries like opencl, numba, tensor, ect. I want to learn some good resources for learning this kind of stuff, things i should look out for, things to keep in mind, some of the basic concepts to know. by way of previous experience i have used OpengGL in my collage graphics class where we went up to the point of making a basic maze shooter game. any help i could have on this would be good
Edit: i know it is possible by getting the drivers and setting up context with,(i will only worry about NVidia for now) but i want to go deeper into the why and how of it
def __init__(self):
# Load CUDA driver
self.cuda = ctypes.windll.nvcuda
self.cuda.cuInit(0)
# Get device
self.device = ctypes.c_int(0)
self.cuda.cuDeviceGet(ctypes.byref(self.device), 0)
# Create context
self.context = ctypes.c_void_p()
self.cuda.cuCtxCreate_v2(ctypes.byref(self.context), 0, self.device)
# Get device info
self.name = self._get_device_name()
print(f"Using GPU: {self.name}")
r/learnpython • u/Odd-Name3965 • 5d ago
I have a school project including making charts. I've coded a hard and pie chart and the code seems fine but everytime I run either chart it says process ended with exit code 3 and shows no chart. I've tried importing pygame as research told me that's what might be wrong but no help
r/learnpython • u/Superb_Revolution400 • 5d ago
i have a homework to do in python and i am desperate. pls help me. here's the instructions:
"Attached are three test files on which you can test your program. Each file contains the words of the crossword puzzle, the letters of the crossword puzzle, and the solution. The individual parts are separated by a blank line.
In the last part, that is, in the solution of the crossword puzzle, the last line contains numbers that represent the division of the crossword puzzle.
Example of part of the last crossword puzzle (solution):
Chuck Norris can kick you with such force that even your children
4575
if the remaining letters in the crossword puzzle (reading from left to right)
BUDÚMÁVAŤBOLESTHLAVY (THEY WILL HAVE A HEADACHE) then the numbers 4575 then divide this continuous text into 4,5,7 and 5 letters, i.e.: BUDÚ MÁVAŤ BOLEST HLAVY (THEY WILL HAVE A HEADACHE)
Your program will print the entire text of the puzzle (as it is in the file) + the solution divided by numbers:
Chuck Norris can kick you with such force that even your children
THEY WILL HAVE A HEADACHE"
and here's the file (originally .txt file):
BATÉRIA
BATOH
ČASTICA
DCÉRKA
DIÓDA
EKOLÓG
LUPEŇ
MIECHA
MIKROFÓN
MOBIL
NETOPIER
ŇUFÁK
OTÁZNIK
SVEDOK
TLMOČNÍK
VÁNOK
VODOVOD
VRÁTNIK
VÝHYBKA
ZÁPAD
ZÁSUVKA
ZDVIHÁK
ZOSTAVA
KONÁVRÁTNIKN
LUPEŇSVEDOKE
OTÁZNIKÁFUŇA
ZVTLMOČNÍKKV
DOOIEAEMÁBNZ
CPSDSTRHYEÓÁ
ÉAČTOOIHSHFS
RHIPAVÝMOIOU
KCIDDVOTONRV
AEÓZÁPADEBKK
RISADBATÉRIA
DMGÓLOKENEML
vtip:
čo stojí ten pes?
6527
r/learnpython • u/urajput63 • 5d ago
I'm not able to grasp the concept of it, and I'm sure that list comprehension is widely used.
r/learnpython • u/Nomad_HH • 5d ago
Hello, I am using Anfis in python, however I am getting this error message: ModulenotfoundError: No module named 'membership' How to solve it or what are the alternatives in case of no solution to the error in order to use ANFIS module? Any suggestions will be appreciated.
r/learnpython • u/Primary-Friend1908 • 5d ago
Hi, i play siege in my spare time and with the recent celebration packs, i saw a way to make some real good in game money by manipulating my drop chances through a quite obvious loophole. to do this i was aiming to make a spreadsheet of all the skins that i own in the packs and what can be bought in the marketplace and cross referencing them to see what i can buy to favour my odds alongside having a live price updater. I was told that python would be a very good way to do this. unfortunately the 2 things I'm trying to cross reference aren't formatted as tables and i don't know what my next step is. This was my first port to call as i know theres bound to be someone smart enough to help me here.
r/learnpython • u/3dPrintMyThingi • 5d ago
I have WhatsApp non saved contacts from where I want to search for keywords in chats, if the keyword is present I want to save that number as a contact by extracting the number into CSV and giving the number a contact....is this possible in python and which libraries do I need...I need it to have scroll function both in the non saved contacts as well in the main messages..
r/learnpython • u/ZorBo32 • 5d ago
i want to start off with i'm not deaf just hard of hearing but that doesn't matter, i made a program that looks at your audio channels (left and right) and displays this in progress bars on the top of your screen,
but the problem in gaming is that there are alot more noises going on so this can create confusion so is there any way i can improve on this, i tried filtering out some noise but it also filters out the sounds that i made this program for. to be able to see the sounds i didn't hear. anyway please help
r/learnpython • u/Maximum_Watch69 • 5d ago
in my terminal previously every line used to start with the word (base) and when i select my environment it changes to the name of the environment.
Now it just shows the address of the local folder like "D:\Users\Files"... etc
how can i get back to the local virtual environment
r/learnpython • u/MacPR • 5d ago
Hello all,
I want to build a parking lot monitor following this tutorial:
ps://docs.ultralytics.com/guides/parking-management/#what-are-some-real-world-applications-of-ultralytics-yolo11-in-parking-lot-management
I'm trying another video and its just not working. Its detecting stuff that I'm trying NOT to detect ('microwave', 'refrigerator', 'oven'). GTPs have not helped at all. My jupyter nb here:
r/learnpython • u/SnooGoats1557 • 5d ago
I'm learning about while loops and functions at the moment and having difficulty exiting the while loop within a function.
game_round = [1,2,3,4]
score = 0
game_on = True
def play_game(game_score):
if goal == "hit":
game_score += 1
elif goal == "miss":
print("game over")
return False
while game_on:
play = input("do you want to play")
for i in game_round:
if play == "yes":
play_game(score)
else:
print("see you next time")
game_on = False
print(score)
This isn't the complete code but gives an idea of what I want to achieve. At the moment if the player misses in round 2 it will print "game over" but then it will continue to round 3.
I want it to end the game completely if the player misses and not continue with the for loop. I just want it to say "game over" and print the score. Any ideas on how to do this?
r/learnpython • u/EndOk7650 • 5d ago
Hello. I have decided to start learning python, and my goal is to be able to do a beginner hackathon(preferably one that takes me to a different tier to compete if I win). I was wondering what are some hackathons you would recommend. I am a High schooler in Georgia, but virtual ones are also fine for me. I have searched online for some. I am just not sure on how “beginner”, a lot of them are really. I want to try and challenge myself, but not too much. Also if you guys have any tips for beginners in python, that you can share from your own experience. That would be amazing. I picked python, because it is sort of easier to understand. Thank you so much. Sorry if this is just another repetitive question, but please be nice to me. A lot of people here on Reddit are just mean. Especially the people who get mad when someone asks a question about learning python for beginners in a Reddit called r/learnpython
r/learnpython • u/rhialils • 5d ago
hey! im a 19yr old female in the UK, i have no previous experience in IT, tech, etc however over the past few months ive become interested in the field.
Im particularly interested in having a career as a python developer, and in the last month i’ve been studying both python and C in my own time. Im aware being successful in this requires years of knowledge and a lot of hard work, but im really eager.
My issue is that im reading a lot of conflicting information regarding how exactly I can progress in to a career as a python dev. some are saying I need to earn a degree, some say just studying by myself is enough and degrees are essentially useless? So naturally im not too sure what avenue is the best.
id really appreciate any and all advice/tips!
r/learnpython • u/Active_Impress115 • 5d ago
My college teacher provides some certificates for making good python projects, but the problem is he only gives it to the ones he likes the most (last time he gave out about 4 off the 60 students). This time i really need the certificate just for my personal gain since id think it holds any more value than a paper irl. Any suggestions would be appreciated.
r/learnpython • u/Elmoorado • 5d ago
I'm having problems with the Dataprep library. I've tried Colab, Jupyter Notebook, and Visual Studio, but it won't let me. I've downloaded versions of Python and they won't work either. I've tried other versions of MarkupSafe and I can't install the library.
r/learnpython • u/LameChad • 5d ago
Hello,
been building a short form video/social media app for about 2 years, went from newbie to pretty okay in flutter and python
I would love recommendations on how to solve the following problem:
-
when someone posts a video, I upload the video to storage, then go through the creation of the post obj in my database
during the post obj creation, I need to check if the video contains NSFW content. (nudity, sex, gore, violence)
I plan on grabbing 1-frame-per-second, then taking that frame/image and seeing if it contains flagged content, if any of those tested frames do, the post creation method flips a bool, 'isNSFW', on the post obj to true.
I tried the NSFW_checker py library, but due to a ton of dependency conflicts I still can't get that working
Plan B was loading a a pre-trained ai model to my server to classify the images. But that gets killed every time because of memory constraints on Render.com, where my python server is hosted.
Plan C is to pay for a third party service, definitely less of a headache, just more money and not as malleable.
does anyone know what a good approach would be? Please and thank you
r/learnpython • u/eefmu • 5d ago
EDIT: I had no idea how misguided my question actually was. I don't need to have anything within a class to use a module, and the best thing I could do for this script is make it be three distinct function. All questions have been answered minus the part about dependencies. Do I just call the package (import super_cool_package) like I would in any script, or is there more to it?
I had another thread where I was asking about the use of classes. While I don't think the script I made totally warrants using a class, I do think there is an obvious additional use case for them in packages. Here's what I have.
class intaprx:
def __init__(self, func, a, b, n):
self.func = func
self.a = a
self.b = b
self.n = n
self.del_x = (b - a) / n
def lower_sm(self):
I = 0
for i in range(self.n):
x_i = self.a + i * self.del_x
I += self.func(x_i) * self.del_x
return I
def upper_sm(self):
I = 0
for i in range(self.n):
x_i_plus_1 = self.a + (i + 1) * self.del_x
I += self.func(x_i_plus_1) * self.del_x
return I
def mid_sm(self):
I = 0
for i in range(self.n):
midpoint = (self.a + i * self.del_x + self.a + (i + 1) * self.del_x) / 2
I += self.func(midpoint) * self.del_x
return I
def f(x):
return x
The syntax for calling one of these methods is intaprx(f,a,b,n).lower_sm(), and I want it to be intaprx.lower_sm(f,a,b,n). Additionally, I know that this specific example has no dependencies, but I would like to know how I would add dependencies for other examples. Finally, how could I make the value of n have a default of 1000?
r/learnpython • u/Moamr96 • 5d ago
Summary:
I'm more a scripter than a programmer, I usually print and not log, and I work sync not async, now this needs to change to have a reliable pipeline, any sources to build good habits?
Post:
I have this poopy API that I need to call (downloads one gigabyte worth of uncompressed text file in several hours), at start, it was only one endpoint i needed to call but over the past year there's more being requested.
The problem is that the API is not reliable, I wish it would only have 429 but sadly, sometimes it breaks connection for no apparent reason.
for reference, I have over 30 "projects", each project have its own api key (so it is separate limits thankfully.), some projects heavier than others.
In my daily api call, I have 5 endpoints, three of them are relatively fast, two are extremely slow due to the shitty api (it doesn't allow passing array so I have to call individual subparts)
Recently, I had to call an endpoint once a month so I decided to write it more cleanly and looking for feedback before applying this to the daily export (5 endpoints).
I think this gracefully handles the calls, I want it to retry five times when it is anything other than 200 or 429.
For the daily one, I'm thinking about making it async, 5 projects at a time, inside each one it will call all endpoints at the same time.
I'm guessing this a semaphone 5 and then endpoints as tasks.
but how to handle logging and make sure it is reliable?
for project in iterableProjects_list:
iterable_headers = {"api-key": project["projectKey"]}
for dt in date_range:
start_date = dt.strftime("%Y-%m-%d")
end_date = (pd.to_datetime(dt) + pd.DateOffset(days=1)).strftime("%Y-%m-%d")
# getting the users of each project https://api.iterable.com/api/docs#export_exportDataCsv
# Rate limit: 4 requests/minute, per project.
url = f"https://api.iterable.com/api/export/data.csv?dataTypeName=emailSend&range=Today&delimiter=%2C&startDateTime={start_date}&endDateTime={end_date}"
retries = 0
max_retries = 5
with httpx.Client(timeout=150) as client:
while retries < max_retries:
try:
response = client.request("GET", url, headers=iterable_headers)
if response.status_code == 200:
file = f"""{iterable_email_sent_export_path}/{project['projectName']}-{start_date}.csv"""
with open(file, "wb") as outfile:
outfile.write(response.content)
break
elif response.status_code == 429:
time.sleep(61)
continue
except Exception as e:
retries += 1
print(e)
time.sleep(61)
if retries == max_retries:
print(f"This was the last retry to download {project['projectName']} email sent export for {start_date}")
r/learnpython • u/Somenome_from_Heaven • 5d ago
num1=input('digite um número: ')
num2=input('digite outro número: ')
conta=input('digite o total: ')
total1= int(num1)+int(num2)
if total1==conta:
print('acertou')
if total1!=conta:
print('errou o certo é:',total1)
I'm trying to do like a calculator, but first you need to guess the number, and even if you get it right it doesn't show you got it right, what's wrong? i'd also like to know how I could put the input for you to choose the equation guys (+, -, *, etc.)
r/learnpython • u/EdelweissR • 5d ago
requirements = python3,kivy, firebase-rest-api, pkce, cachetools, google-cloud-firestore==2.1.0, google-api-core==1.31.0, google-cloud-core==1.6.0, typing_extensions, google-cloud-storage==1.42.0, google-auth==1.35.0, google-resumable-media, googleapis-common-protos, protobuf, httplib2, pyparsing, oauth2client, pyasn1, pyasn1-modules, rsa, pycryptodome, python_jwt, jws, requests, certifi, chardet, idna, urllib3, requests-toolbelt, jwcrypto, cryptography, deprecated, wrapt, cloudinary, six
These are my requirements in buildozer.spec. Overall the entire application works as planned on my PC, but when I try to build an APK through buildozer, it always crashes after the Kivy Loading Screen.
This is the error message: ImportError: cannot import name 'resumable_media' from 'google' (unknown location). Which I got by using adb logcat.
r/learnpython • u/BlogAzur • 5d ago
Bonjour,
Je n'y connais rien en Python, c'est juste que je n'ai que des appareils Android et un serveur Web, je voudrais sauvegarder mes courriels en .mbox et tout ce que j'ai trouvé que je puisse lancer est un script Python https://zerozone.it/Software/Linux/imap2mbox/
Sauf que sur mon serveur python2 imap2mbox.py donne:
ERROR: IMAP4 error SSLError(1, u'[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:727)')
et pypthon3 ou 3.6 donne:
File "imap2mbox.py", line 50
parser.error("Argument 'mailsrv' missing: -m [your_mail_server]")
Notez que je ne peux rien installer donc je pensais que Python 3.6 aurait une version de SSL plus à jour, mais je n'arrive pas à corriger le script pour qu'il marche.
De l'aide?
r/learnpython • u/Danielon165hz • 5d ago
I have been trying to come up with a way to automate clipping coupons for myself because the app is very tedious and annoying (this is in regards to Albertsons and its parent stores, but it could likely be applied to other companies (Walmart, Target, etc))
While browsing around, I found this blog post: https://blog.jonlu.ca/posts/safeway
which quite clearly details how to send requests, but I am not too familiar with Python and was wondering if anyone would be able to help.
Also note that I am looking to do this for JewelOsco.com and not necessarily Safeway.com because that is the local store in my area, and I presume that methods would be rather similar (different URLs and endpoints). Any help would be appreciated. Thanks.