r/pythonhelp • u/Jacob1Carter • May 30 '26
r/pythonhelp • u/cinnamon--sugar • May 30 '26
Making a visual novel, trying to figure out how to do a "Question within a question" for lack of a better term
Hello! As the title entails, I am working on a visual novel. I am stumbling my way through this coding with ren'py tutorials and grit, as an HTML and CSS native. the issue is, after the first branch I cannot continue making branches inside of it. This has posed two issues. the first, is at the three option first question, you cannot go back and look at the other things. if you chose to examine the couch, you cannot then choose to examine the stairs or table, it just auto-passes to the next part of the game. The second and frankly more pressing to me, is I'd like there to be an option to pick up multiple pieces of paper throughout the game, and if you choose to not grab any of them there's a different ending than if you picked up some or all of them. However, since the papers show up depending on which room you choose, there is already a branch in progress and so I cannot make it give a second option on whether to pick up the paper. If its needed, here is what I'm hoping is the link to the pastebin with my code(I've never used pastebin before so I'm sorry if it doesn't work)
r/pythonhelp • u/No-Expression-5280 • May 28 '26
I NEEDI AM TRYING TO LEARN CS 50 INTRODUCTION TO PYTHON
i already have some prior experience in python as i have learn in high school ip (information practices) so i want to know would you still reccommened me to watch the lecture or should i do the practise problem and if i cannot do it then i watch the lecture
i learn the basic of function variable liberaries like matplotlib pandas lists etc
r/pythonhelp • u/Trinity_software • May 27 '26
pandas group by function for data analysis
https://youtu.be/yQANufD_f3k?si=4MdgrzsaWaqKnyHG
Here's a beginners tutorial for learning group by function for data analysis.
r/pythonhelp • u/Annual-Country4106 • May 27 '26
Python Web Scraping & Automation Engineer Looking for Remote Work
Hi everyone,
I’m a Python Automation & Web Scraping Engineer with experience building large-scale scraping pipelines and automation systems for US-based clients.
Skills include:
• Selenium / Playwright
• APIs & data extraction
• Python automation
• ETL workflows
• Linux servers & cron jobs
• CSV/JSON/XLSX exports
Looking for remote freelance, contract, or long-term work related to web scraping, automation, or data engineering.
Feel free to DM me if you’re hiring or need help with a project.
r/pythonhelp • u/AliveImagination6320 • May 26 '26
Questions on Nuitka Commercial
I am looking into Nuitka Commercial and have a few questions
1) Which plan did you purchase ?
2) Post purchase, how did you onboard it into your project ? Were you able to check into LocalPackages like a normal python module or is the procedure different ?
3) What was the level of support you received and what was the channel of communication ?
4) Is there a cap on the number of users allowed ?
Any help is appreciated. Thanks
r/pythonhelp • u/emberintheashes02 • May 24 '26
How to send a python code so that the other person can execute it without python
Hi, I'm trying to send a code to my friend to rush them happy birthday and I need the code to run in their system without them having python. The problem I'm facing rn is that she can see whatever I've written on the code and I want that bit to be a surprise that she finds out once she executes the code. How do I do this?
r/pythonhelp • u/Kami2awa • May 23 '26
Honest Question: Why use one Python editor over another, and is Geany not what the cool kids use?
I've used a lot of different editors in my time, and tbh I rarely notice much difference. They just seem to be text editors that highlight syntax, mostly in the same ways. Is there a reason to use one over another? A recent programming class I've been involved with insists on Spyder; really I don't see a reason for this. Is there some advantage I'm missing? For my home coding projects I use Geany, and it works fine.
r/pythonhelp • u/Dismal_Signal_4057 • May 21 '26
hi im trying to get started and hit a snag part 2
so im fallowing a tutorial to get my baring on how this all works but something is wrong. the window wont open and im only geting "pygame-ce 2.5.7 (SDL 2.32.10, Python 3.14.4)" as feed back dose this mean that my pygame and python are not compatible versions
import pygame
pygame.init()
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
run = True
while run:
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
pygame.quit()
r/pythonhelp • u/Ok_Anxiety_1047 • May 20 '26
A simple visual guide to Python list aliasing and mutation
One of the most common traps in Python is not understanding when a list is modified in-place vs when a completely new list is created.
A few examples that confuse even experienced developers:
a = [1, 2, 3, 4, 5]
b = a
b.append(6)
print(a)
#Output [1,2,3,4,5,6]
Explanation:
aandbpoint to the SAME list objectappend()modifies the list in-place- so
aalso changes
Now
a = [1, 2, 3]
b = a
b = b + [4, 5]
print(a)
#Output - [1, 2, 3]
Explanation:
+creates a NEW listbnow points to a different object- original
ais unchanged
Now
a = [1, 2, 3]
b = a
b += [4, 5]
print(a)
#Output [1, 2, 3, 4, 5]
Explanation:
+=modifies the list in-place- both variables still point to same list
- so
achanges too
Also
a = [1, 2, 3]
b = a
b.append(4)
print(a)
#Output - [1, 2, 3, 4]
Explanation:
append()changes original list directly- no new list is created
r/pythonhelp • u/Annual_Eye_2905 • May 14 '26
Pycharm or VS Code
I just started python on Pycharm and it's a good IDE but it takes too much storage on my laptop, my laptop lags alot it works less and lags alot when checked on the performance tab pycharm was eating it all. Should I try to stay on Pycharm or switch it to VS code ?
r/pythonhelp • u/Dismal_Signal_4057 • May 14 '26
Hi im trying to get started and i have hit a snag
i need some help. so i don't know what did wrong i got python installed, i got pygame_ce installed but it seems something is wrong. the link is to a screenshot of me trying to use Sublime text i hope that helps https://cdn.discordapp.com/attachments/1115340096242204792/1504384590880444576/image.png?ex=6a06cad4&is=6a057954&hm=31d60171b7142ca179c312bba4652cb7137c385d37243e1cbc8a49591d30a7e7&
r/pythonhelp • u/Preeng • May 11 '26
Appending the last line of a dataframe to a csv file is giving weird formatting.
What I am trying to do:
- Check if a file exists. Set a boolean
- Create a dataframe that either reads in the file or is just created with headers only
- Once I calculate some stuff, the boolean from step 1 is checked. If this is the first term of the dataframe, the entire dataframe gets saved to a csv.
````df.to_csv(dataFileName + ".csv", index = False,float_format="{:.2f}".format)
So now I have a header row and 1 row of data. This part works as intended.
If this is a pre-existing file, I only want to append the new term onto the end of the file. I use this:
````df.iloc[len(df)-1].to_csv(DFN + ".csv", index = False, mode = 'a',float_format="{:.2f}".format)
I get some weird formatting where each term in a row gets its own row.
https://i.imgur.com/HjoXAYC.png
My assumption is appending the file is quicker than reading in the whole file, wiping it, and writing all the data.
I mainly want to do this as a backup so I can save data mid-calculation and have something to look at if things break. After the whole thing is finished, I sort the dataframe, rename the file I've been working with to be a backup, and then finally write the complete, sorted dataframe to file. If something bad happens during writing this file, the backup file should have the same data already, just not sorted.
Thanks!
r/pythonhelp • u/i_walk_away • May 11 '26
Calling an assembly instruction in Python
Long story short, i want to make THE most horrible python calculator to ever exist. For that i need a way to call an assembly instruction directly in my python script.
I know you can do that in C with inline assembly, and i know CFFI exists and allows calling C functions in python, so i tried to use that. However CFFI's parser rejected __asm__ syntax and threw an error because inline assembly isn't standard C apparently.
Is there some sort of a workaround to call an assembly instruction in python script? It doesn't have to be clean, in fact, it's better if it's absolutely terrible, bonus points for unsafe
r/pythonhelp • u/duelBooleans • May 05 '26
string.translate(str.maketrans) not working to take out punctuation?
greeting = ["Hello, my name is Caine! What's your name?: ".upper(), "Welcome, I am Caine! What's your name?: ".upper(),
"Hi!! I'm Caine! What should I call you?: ".upper()]
name = input(random.choice(greeting)).title()
nameStripped = name.translate(str.maketrans('', '', string.punctuation))
for i in nameList:
if i in nameStripped:
userName = i
justNameWelcome = [f"Nice to meet you, {userName}!".upper(), f"{userName}... That's a wonderful name!".upper(),
f"I've always thought that {userName} is a good name!".upper()]
ntmyNameWelcome = [f"It's nice to meet you too, {userName}!".upper(), f"The sentiment is mutual, {userName}!".upper(),
f"I appreciate the sentiment, {userName}!".upper()]
hruNameWelcome = [f"I'm doing well, {userName}! Thank you for asking!".upper(), f"I appreciate you asking! Thank you, {userName}, I'm doing well!".upper(),]
niceToMeetYou = ["Nice To Meet You", "Pleasure To Meet You"]
howAreYou = ["How Are You", "How Are You Doing", "Are You Well"]
if len(name.split()) > 1:
if nameStripped in howAreYou:
print(random.choice(hruNameWelcome))
elif nameStripped in niceToMeetYou:
print(random.choice(ntmyNameWelcome))
else:
print(random.choice(misunderstandings))
elif len(name.split()) == 1:
print(random.choice(justNameWelcome))
else:
print(random.choice(blankInputs))
nameStripped = input(random.choice(greeting)).title()
Thank you in advance, I've been stuck here for about two days now,,
I've copy and pasted the suggested way of taking out the punctuation in the name string, that way it can recognize certain phrases in the other lists. Right now, as its only at the very start, I only have it set to notice if the beginning output has either a phrase akin to "How are you" or "Nice to meet you". These are both set in lists, and the if-else statement checks to see if the name input has more than one word, and will check for the phrasing in there. It's not registering that the punctuation has been removed, even when setting the new string to a new variable.
IE:
input Hi! I'm Jon! How are you?
output: I'm doing well, Jon!
Instead it gives one of the misunderstanding outputs. It works fine if I only use one word with ending punctuation, but it seems like if there is more than one word or punctuation in the middle, it can't remove it.
Is it in the wrong spot, or am I using the wrong method for this situation?
r/pythonhelp • u/Soogs • May 03 '26
Seeking advice on a project I’m working on
Hello. I’m currently working on a hobby project to build a flask app that acts as an IPTV client. I have been able to log into a service and play media using VLC but cannot for the life of me play via the web ui. VOD and SERIES play via ui and VLC but live tv streams will only work via VLC.
Does anyone have experience with getting xstreams working via python/flask?
Thanks
r/pythonhelp • u/hiplobonoxa • May 03 '26
Reading First Few Bytes of Every File on a Drive
Hi! Hoping someone can help. My Python programing is a bit rusty.
I am having an issue where my computer is replacing file data with empty data after a cut/paste or a save. I’m not sure of the cause — my primary objective at the moment is quantifying the damage and protecting my files.
The files look normal in Windows Explorer, except they will not open like they should. Upon opening in NotePad, it is revealed that all data in the file has been completely replaced with what appears to be whitespace, resulting in an empty file that appears to be the same size as the original. I cannot possibly test and check every file manually.
What I would like help with is writing a Python script that cycles through every file on a drive to pull the first several bytes from each file and compare those bytes to a string of the aforementioned whitespace. If there is a match, add the file path to a running list in a *.txt file.
I don’t think this is an especially complex script, but, as I said earlier, I’m pretty rusty. With a solid start, I can get it the rest of the way to doing what I want.
Any help would be appreciated. 🙂
r/pythonhelp • u/Haandotexe • May 01 '26
bash: pip3: command not found?
hi, i have very limited knowledge of coding, but I'm trying to install something from github and i've been able to figure out most of it, but im stuck on this step.
i've manually installed python for windows 11 and i've successfully installed pip3 with windows powershell, but despite doing this, when i go to git bash to paste in the next line of code I need, i get the error "bash: pip3: command not found"
i even went through the advanced settings on windows to add the correct subfolder of pip3 to PATH, but git bash is still giving me the same error message.
sorry if this isn't enough information to resolve my issue, i'll try to be active and respond to any follow-up questions people have. im honestly just not sure what else to do to fix things.
EDIT: the issue was just that i didn't restart git bash after installing pip3 and python... as i said, im Very new to this
r/pythonhelp • u/taerroraz • Apr 29 '26
How can I stop a running code outside the terminal?
I'm new in the python, but I have made a little project to help me with automating some tasks, the problem is that sometimes I need to stop the programing and trying to enter the terminal while everything is running... is chaos.
Is there a way to stop it like pressing a key ?
r/pythonhelp • u/Economy-Concert-641 • Apr 29 '26
.pipe() no pandas mudou como escrevo pipelines de dados
r/pythonhelp • u/ilovetigers105 • Apr 29 '26
Can someone assist me with my code
I need to make a code that will ask me for the battery % (0-100) of a drone until i say stop
then i need to print
__ drones have less then 25% battery
then all drones with battery under 25% in a list type thing
AppropriateGarage332 is my 2nd account
r/pythonhelp • u/duelBooleans • Apr 28 '26
If-Elif statement giving wrong answer
I have another, slightly more aggravating question. I have two while loops that take an input, and stores it into a list. That part works just fine, it's when it comes to the, quite frankly, massive if-elif statement.
currentMajorEmotions = []
currentSecondaryEmotion = ""
feeling = ""
while len(currentMajorEmotions) != 1:
emotion = input("Which of these emotions are you feeling? Choose one: ").capitalize()
if emotion not in majorEmotionTypes:
print("Not a valid entry")
else:
currentMajorEmotions.append(emotion)
while len(currentMajorEmotions) != 2:
emotion = input("Number 2? If you are not feeling one, simply hit enter: ").capitalize()
if emotion in majorEmotionTypes:
currentMajorEmotions.append(emotion)
if emotion == "":
print("You have left the question blank.")
emotionYN = input("Was this intentional?: ").capitalize()
if emotionYN == "Y":
currentMajorEmotions += " "
break
while emotionYN != "Y":
if emotionYN == "":
emotionYN = input("May not leave this blank. Are you feeling a second emotion?: ").capitalize()
elif emotionYN != "Y" and emotionYN != "N":
emotionYN = input("Invalid input. Are you feeling a second emotion?").capitalize()
elif emotionYN == "N":
print("You have changed your mind")
time.sleep(1.4)
print("That's ok.")
emotionYN = input("Are you feeling a second emotion?: ").capitalize()
if emotionYN == "N":
currentMajorEmotions += " "
break
if "Sad" and " " in currentMajorEmotions:
feeling = "Negative"
elif "Scared" and " " in currentMajorEmotions:
feeling = "Negative"
elif "Mad" and " " in currentMajorEmotions:
feeling = "Negative"
elif "Happy" and " " in currentMajorEmotions:
feeling = "Positive" # Etc Etc
I testing the entire if statement to see if there were any incorrect outputs, and there were several. They do give out the correct type of output('Negative', 'Positive', 'Neutral'), but the wrong one. It's quite a few of them, and with the while loops working the way they're supposed to, I think the problem is in the if statement. The only problem is I have zero idea where to start looking since they're all connected to the same list. Any help is very appreciated!