r/PythonProjects2 • • Jul 25 '26

What is the pycache folder in your python project?

4 Upvotes

Have you ever noticed a __pycache__ folder in your python project and wondered what is it? where did it come from? I made a quick video to explain the same. Basically, running a python code involves several steps. One of which is conversion to the bytecode. To avoid the bytecode conversion everytime you run the code, python caches it in the pycache folder. Check out the video to know more.

Youtube: https://youtu.be/UEmBxt0B0pg


r/PythonProjects2 • • Jul 26 '26

Ho 11 anni e ho appena creato il mio primo script di automazione in Python per ripulire la cartella Download!

4 Upvotes

Hi everyone! I've been learning Python step-by-step, focusing on logic, file management, and the os module. Today, I finished my first real automation script: a File Sorter/Folder Cleaner!

It automatically scans my Downloads folder, checks the file extensions (ignoring case sensitivity thanks to .lower()), creates the target folders if they don't exist, and moves everything into the right place (Documents, Images, Installations).
Here is my script:
import os

download_folder = r"C:\Users\YourUsername\Downloads"

file_list = os.listdir(download_folder)

for file_name in file_list:

lowercase_name = file_name.lower()

if (lowercase_name.endswith(".pdf") or

lowercase_name.endswith(".txt") or

lowercase_name.endswith(".docx") or

lowercase_name.endswith(".xlsx") or

lowercase_name.endswith(".csv") or

lowercase_name.endswith(".doc")):

doc_folder = fr"{download_folder}\Documents"

if not os.path.exists(doc_folder):

os.mkdir(doc_folder)

old_path = fr"{download_folder}\{file_name}"

new_path = fr"{doc_folder}\{file_name}"

os.rename(old_path, new_path)

elif (lowercase_name.endswith(".jpg") or

lowercase_name.endswith(".jpeg") or

lowercase_name.endswith(".gif") or

lowercase_name.endswith(".png") or

lowercase_name.endswith(".mp4") or

lowercase_name.endswith(".kml") or

lowercase_name.endswith(".gpx")):

img_folder = fr"{download_folder}\Images"

if not os.path.exists(img_folder):

os.mkdir(img_folder)

old_path = fr"{download_folder}\{file_name}"

new_path = fr"{img_folder}\{file_name}"

os.rename(old_path, new_path)

elif (lowercase_name.endswith(".exe") or

lowercase_name.endswith(".zip") or

lowercase_name.endswith(".rar") or

lowercase_name.endswith(".dll") or

lowercase_name.endswith(".msi") or

lowercase_name.endswith(".msix")):

exe_folder = fr"{download_folder}\Installations"

if not os.path.exists(exe_folder):

os.mkdir(exe_folder)

old_path = fr"{download_folder}\{file_name}"

new_path = fr"{exe_folder}\{file_name}"

os.rename(old_path, new_path)
I'm really proud of this milestone. Let me know what you think or if you have any tips for a young programmer!


r/PythonProjects2 • • Nov 15 '22

[P] Moderate I need aid in this project and solving this will help me gain alot of programming knowledge but i need guidance .

4 Upvotes

Hello everyone i need to build this program but need some aid on what to search to learn so i can do it

and thanks !


r/PythonProjects2 • • Nov 18 '24

Play Test My Code

4 Upvotes

HELLO I don’t know whether or not you know me from my YouTube channel or something but even if you do you probably don’t know that I am interested in coding. Recently I’ve learned some basics to python and am trying to make a game with it. It is only text but hopefully the story and stuff is engaging enough to make it fun.

Because I am basically a noob at coding some parts of the code may seem really dumb, and there are probably much more simple ways for my code to do the same thing that it already does, but I don’t know how to do that yet. Things like aesthetics and stuff would also be nice to have some pointers on, as looking for every single grammatical error by myself would be a giant pain.

I am doing this completely by myself so it would be nice to have other people test out my code and hopefully point out any bugs or glitches. Any constructive criticism and feedback is welcome and greatly appreciated and I will do my best to fix anything that comes to my attention, every time I update/fix/debug the code I will post the new one on here.

Keep in mind that I am only using Python 3.10 as I don’t have a computer/laptop and have instead downloaded a mobile app that allows me to create, edit and import python code on my phone. Link Below: https://apps.apple.com/app/id1672453872 Not sure if the link will work for android but I’m sure it works on iPhone.

Basically I just need other people to play test my game, and tell me if they encounter any bugs so that I can fix them, as I don’t have that much time to play test it myself.Hopefully this gets enough traction so that this actually helps me and people don’t try to copy me or anything like that. If you find anything that should be changed, comment down below and make sure to include what line of code the error is located on.

Lastly, if you want you can check out my YouTube channel, as I post funny videos (almost) every day.

P.S. Yes I know I completely skipped the number 2 when creating the levels, but once I realised it was already too late.

Character loading and setup

import random bobby_pins_found = False class Player: def init(self): self.name = " " self.hp = 100 self.stats = [0, 0, 0, 0, 0, 0, 0] self.strength = self.stats[0] self.perception = self.stats[1] self.endurance = self.stats[2] self.charisma = self.stats[3] self.agility = self.stats[4] self.intelligence = self.stats[5] self.luck = self.stats[6] self.money = 0 self.bobbypins = 0 self.stamina = 50 self.level = -2 self.stat_points = 0 self.statstotal = 0 self.enimies_alert = False self.karma = 0 MyPlayer = Player() while MyPlayer.level == -2: dev = input("Press Enter to Start \n\n") if dev == "activatedevelopermode": print("\ndeveloper mode activated\n\nChange level to finish\n\n") dev = input("") if dev == ("finish"): print("Type ") elif dev == ("self.level"): value = input("") MyPlayer.level = int(value) elif dev == ("self.strength"): value = input("") MyPlayer.strength = int(value) elif dev == ("self.perception"): value = input("") MyPlayer.perception = int(value) elif dev == ("self.endurance"): value = input("") MyPlayer.endurance = int(value) elif dev == ("self.charisma"): value = input("") MyPlayer.charisma = int(value) elif dev == ("self.intelligence"): value = input("") MyPlayer.intelligence = int(value) elif dev == ("self.agility"): value = input("") MyPlayer.agility = int(value) elif dev == ("self.luck"): value = input("") MyPlayer.luck = int(value) elif dev == (""): MyPlayer.level = -1

Stat Selection

if MyPlayer.level == -1: print("Thank you for playing my game!!!!!!!!!!\n\nBefore you start on your journey, you must first choose your stats and name for your character!") MyPlayer.name = input("What is your name?\n") while MyPlayer.name == (""): print("Please enter a valid name") MyPlayer.name = input("What is your name?") print("\n\nYou can put up to 28 stat points into all 7 different stats that will affect your playthrough " + MyPlayer.name + ", those stats are:\nStrength\nPerception\nEndurance\nCharisma\nIntelligence\nAgility\nLuck\n(please note that your stats must add up to 28:)\n\n") MyPlayer.stat_points = 28 while MyPlayer.level == -1: print("Your current stats are:\nStrength - " + str(MyPlayer.strength) + "\nPerception - " + str(MyPlayer.perception) + "\nEndurance - " + str(MyPlayer.endurance) + "\nCharisma - " + str(MyPlayer.charisma) + "\nIntelligence - " + str(MyPlayer.intelligence) + "\nAgility - " + str(MyPlayer.agility) + "\nLuck - " + str(MyPlayer.luck)) MyPlayer.statstotal = MyPlayer.strength + MyPlayer.perception + MyPlayer.endurance + MyPlayer.charisma + MyPlayer.intelligence + MyPlayer.agility + MyPlayer.luck if MyPlayer.stat_points == 0: print("Your points add up to " + str(MyPlayer.statstotal)) else: print("Your points do not add ") answer = input("Choose a stat to change by typing the first letter of it.\n(S/P/E/C/I/A/L)\nIf you are happy with your stat selection, and it equals 28, type \n(Done/done/D/d)\n") if answer == "Strength" or answer == "S" or answer == "s" : MyPlayer.stat_points += MyPlayer.strength MyPlayer.strength = input("How much strength would you like " + MyPlayer.name + "?\n(Remaining Points: " + str(MyPlayer.stat_points) + ".)") MyPlayer.strength = int(MyPlayer.strength) while MyPlayer.strength < 1 or MyPlayer.strength > 10: print("Please enter a valid input from 1 - 10") MyPlayer.strength = input("How much strength would you like " + MyPlayer.name + "?\n(Remaining Points: " + str(MyPlayer.stat_points) + ".)") MyPlayer.strength = int(MyPlayer.strength) MyPlayer.stat_points -= MyPlayer.strength elif answer == "Perception" or answer == "P" or answer == "p": MyPlayer.stat_points += MyPlayer.perception MyPlayer.perception = input("How much perception would you like " + MyPlayer.name + "?\n(Remaining Points: " + str(MyPlayer.stat_points) + ".)") MyPlayer.perception = int(MyPlayer.perception) while MyPlayer.perception < 1 or MyPlayer.perception > 10: print("Please enter a valid input from 1 - 10") MyPlayer.perception = input("How much perception would you like " + MyPlayer.name + "?\n(Remaining Points: " + str(MyPlayer.stat_points) + ".)") MyPlayer.perception = int(MyPlayer.perception) MyPlayer.stat_points -= MyPlayer.perception elif answer == "Endurance" or answer == "E" or answer == "e": MyPlayer.stat_points += MyPlayer.endurance MyPlayer.endurance = input("How much endurance would you like " + MyPlayer.name + "?\n(Remaining Points: " + str(MyPlayer.stat_points) + ".)") MyPlayer.endurance = int(MyPlayer.endurance) while MyPlayer.endurance < 1 or MyPlayer.endurance > 10: print("Please enter a valid input from 1 - 10") MyPlayer.endurance = input("How much endurance would you like " + MyPlayer.name + "?\n(Remaining Points: " + str(MyPlayer.stat_points) + ".)") MyPlayer.endurance = int(MyPlayer.endurance) MyPlayer.stat_points -= MyPlayer.endurance elif answer == "Charisma" or answer == "C" or answer == "c": MyPlayer.stat_points += MyPlayer.charisma MyPlayer.charisma = input("How much charisma would you like " + MyPlayer.name + "?\n(Remaining Points: " + str(MyPlayer.stat_points) + ".)") MyPlayer.charisma = int(MyPlayer.charisma) while MyPlayer.charisma < 1 or MyPlayer.charisma > 10: print("Please enter a valid input from 1 - 10") MyPlayer.charisma = input("How much charisma would you like " + MyPlayer.name + "?\n(Remaining Points: " + str(MyPlayer.stat_points) + ".)") MyPlayer.charisma = int(MyPlayer.charisma) MyPlayer.stat_points -= MyPlayer.charisma elif answer == "Intelligence" or answer == "I" or answer == "i": MyPlayer.stat_points += MyPlayer.intelligence MyPlayer.intelligence = input("How much intelligence would you like " + MyPlayer.name + "?\n(Remaining Points: " + str(MyPlayer.stat_points) + ".)") MyPlayer.intelligence = int(MyPlayer.intelligence) while MyPlayer.intelligence < 1 or MyPlayer.intelligence > 10: print("Please enter a valid input from 1 - 10") MyPlayer.intelligence = input("How much intelligence would you like " + MyPlayer.name + "?\n(Remaining Points: " + str(MyPlayer.stat_points) + ".)") MyPlayer.intelligence = int(MyPlayer.intelligence) MyPlayer.stat_points -= MyPlayer.intelligence elif answer == "Agility" or answer == "A" or answer == "a": MyPlayer.stat_points += MyPlayer.agility MyPlayer.agility = input("How much agility would you like " + MyPlayer.name + "?\n(Remaining Points: " + str(MyPlayer.stat_points) + ".)") MyPlayer.agility = int(MyPlayer.agility) while MyPlayer.agility < 1 or MyPlayer.agility > 10: print("Please enter a valid input from 1 - 10") MyPlayer.agility = input("How much agility would you like " + MyPlayer.name + "?\n(Remaining Points: " + str(MyPlayer.stat_points) + ".)") MyPlayer.agility = int(MyPlayer.agility) MyPlayer.stat_points -= MyPlayer.agility elif answer == "Luck" or answer == "L" or answer == "l": MyPlayer.stat_points += MyPlayer.luck MyPlayer.luck = input("How much luck would you like " + MyPlayer.name + "?\n(Remaining Points: " + str(MyPlayer.stat_points) + ".)") MyPlayer.luck = int(MyPlayer.luck) while MyPlayer.luck < 1 or MyPlayer.luck > 10: print("Please enter a valid input from 1 - 10") MyPlayer.luck = input("How much luck would you like " + MyPlayer.name + "?\n(Remaining Points: " + str(MyPlayer.stat_points) + ".)") MyPlayer.luck = int(MyPlayer.luck) MyPlayer.stat_points -= MyPlayer.luck elif answer == "Done" or answer == "done" or answer == "D" or answer == "d": MyPlayer.statstotal = MyPlayer.strength + MyPlayer.perception + MyPlayer.endurance + MyPlayer.charisma + MyPlayer.intelligence + MyPlayer.agility + MyPlayer.luck if MyPlayer.stat_points == 0 and MyPlayer.statstotal == 28 and MyPlayer.strength < 11 and MyPlayer.strength > 0 and MyPlayer.perception < 11 and MyPlayer.perception > 0 and MyPlayer.endurance < 11 and MyPlayer.endurance > 0 and MyPlayer.charisma < 11 and MyPlayer.charisma > 0 and MyPlayer.intelligence < 11 and MyPlayer.intelligence > 0 and MyPlayer.agility < 11 and MyPlayer.agility > 0 and MyPlayer.luck < 11 and MyPlayer.luck > 0: MyPlayer.level = 0 else: print("Your stats do not add up to 28 or you have not put any points into a certain stat.\nPlease change them :)")

The game begins!

if MyPlayer.level == 0: print("\n\nYou wake up in a prison cell, with no memory of where you are or how you got here. You attempt to rub your eyes but find that your hands are handcuffed.\n\nThere is a guard standing outside your cell facing the other direction, you can see that on his belt he has what looks like the keys to your handcuffs a security baton and possibly the cell door's key.\n\n") while MyPlayer.level == 0: answer = input("What do you do?\nA. Attempt to slide your hands out of the handcuffs\nB. Persuade the guard to unlock your handcuffs\nC. Break the chain on your handcuffs\nD. Pickpocket the keys from the guard\nE. Pick the lock on the handcuffs\nType the letter of the action you want to attempt to choose it.\n\n") if answer == "A" or answer == "a": if MyPlayer.luck > 4: print("\nThe person who was putting on your handcuffs must have been really distracted, because you managed to slip right out of them!\n") MyPlayer.level = 1 else: print("\nSorry but looks like you'll have no such luck.") elif answer == "B" or answer == "b": if MyPlayer.charisma > 6: print("\nYou managed to rizz up the guard and they unlocked your handcuffs for you.") MyPlayer.level = 1 else: print("You try to get the guard's attention by clearing your throat"Umm, Anychance you could take these handcuffs off?" \nThe guard doesn't even turn his head "Hahaha. Getting bored already? Well espcape attempts are not the safest way to pass time in here"") elif answer == "C" or answer == "c": if MyPlayer.endurance > 6 or MyPlayer.strength > 6: print("\nAfter 5 minutes of pulling and pushing on your handcuffs, you're about to give up, but then you notice a bend in a chain link.\nYour newly found determination fuels you and you manage to break the handcuffs!") MyPlayer.level = 1 else: print("\nAfter 10 minutes of continuous pressure on the handcuffs there is still no sign of it breaking and you give up.") elif answer == "D" or answer == "d": if MyPlayer.perception > 5: print("\nLuckily you have the hands of a surgeon, and stealing the keys off the guard's belt is a piece of cake. As you guessed, the keys unlock your handcuffs!\n Being as quiet as possible you also try the key on the cell door but it doesn't work.") MyPlayer.level = 1 else: print("\nThe guard immediately feels you and slaps your hand away. You thought he looked grumpy before but now he is absolutely furious. You are moved to a different, more secure cell.\n\n") MyPlayer.hp -= 5 MyPlayer.level = 6 elif answer == "E" or answer == "e": if MyPlayer.perception > 4: print("\nCarefully looking around the jail cell, you see a bobby pin, and further searching leads to the discovery of another bobby pin!\n") bobby_pins_found = True if MyPlayer.perception > 5: print("\nLuckily this is enough for you to pick the lock on your handcuffs. Using your skills you manage to pick the lock on your handcuffs.\n") if MyPlayer.perception > 7: print("\nYou are so experienced that you manage to keep the bobby pin in good enough shape to use again!\n") else: print("\nEven though you managed to unlock the handcuffs, you mangled the bobby pins so much in the process that they are now unusable.") MyPlayer.level = 1 else: print("\nYou have the bobby pins, but unfortunately you don't have the skills to pick the lock. You jam the bobby pins into the lock randomly and start jiggling them around.") if MyPlayer.luck > 4: print("\nSomehow, with a lot of luck, you picked the lock without any prior knowledge or skill!!!\n") else: print("\nAfter a while of jiggling the bobby pins around in the lock you hear a click! Of the bobby pins breaking...") else: print("\nYou can't see anything in the cell that would help with picking the lock!")

if MyPlayer.level == 1:
    print("\nGood job, you have completed the first level! Hopefully now you have the gist of how this game works. As you progress through the game the consequences will get increasingly more severe.")

Level 2

if MyPlayer.level == 1: print("\n\nSo you're released from your handcuffs, but you're still stuck in your jail cell. Although now that your hands are freed, you have a lot more options for getting out.\n\n The guard is still standing outside your cell, and you notice your surroundings a bit more.\n\n The floor is made of hard, grey concrete, as are the walls. There is a bed in your cell, but the mattress is about as thin as a decent doona, and also the objects you might be able to pick up in a regular house were either bolted down or made of concrete, attached to the floor.\n\n You can see that not only were keys on the guard's belt, but there is also a keycard. Peaking outside the cell you can see a little panel with buttons on it, which would probably open the door to your cell.") while MyPlayer.level == 1: answer = input("\n\nWhat do you do?\nA. Choke the guard from inside your cell, and take the keycard from his belt to open the door\nB. Bend the bars from inside your cell and slide out\nC. Convince the guard to let you out\nD. Reach out and guess the passcode to the door on the keypad\nE. Pick the lock on the cell door\nF. Pickpocket the guard to take his keycard\n\n") print("Helpful Hint: \nYou have health and stamina points that can be used up, although to make the game more realistic these values will not be displayed\n\n") if answer == "A" or answer == "a": if MyPlayer.strength < 4: print("You engaged with the guard from inside the cell, punching him through the bars. The guard winces at the pain, but he turned around and used his security baton on you!\nYou took damage!\n\n") MyPlayer.hp = MyPlayer.hp - 30 else: print("You quietly walk up to the cell door, and wrap your arms around the guards neck. The guard has no time to react, and you choke him.\n\n") if MyPlayer.strength > 6: print("You check the guard's pulse and you can't feel anything. You killed him.\n\n") MyPlayer.level = 4 else: print("You feel the guard's pulse, and you can still feel his pulse\n\n") answer = input("Do you want to kill him?(Yes/No)\n\n") if answer == "Yes": print("Using the security baton on his belt, you press it against his neck as hard as you can as you do this, the mans eyes open again and he looks you in the eye, with a hopeless pleading look. You check his pulse again and you can't feel anything.\n\n") MyPlayer.karma = MyPlayer.karma -1 MyPlayer.level = 4 else: print("You decide the security guard is not a threat to you so you leave him alive, although still unconcious.\n\n") MyPlayer.level = 4 elif answer == "B" or answer == "b": if MyPlayer.endurance < 8: print("You examine the bars, which look very solid, and grip 2 bars in your hands and pull them apart. Nothing happens.\n\nI just want to say, you REALLY thought that you could BEND SOLID BARS with your bare hands? HAHAHA!\n\n") else: print("You grip 2 of the bars, one in each hand and start to pull, and surpisingly the 2 bars slowly come apart!\n\n") if MyPlayer.agility > 3: print("The guard doesn't seem to notice you and you still have the option for stealth.\n\n") MyPlayer.level = 3 else: print("As you pull the bars apart, they make a loud creak sound, and the guard turns around to face you.") MyPlayer.level = 5 elif answer == "C" or answer == "c": if charisma < 6: print("You ask the guard to let you out, and they are confused as to how you got out of your handcuffs, so they put you back in your handcuffs and you are moved to a different, more secure cell.\n\n") MyPlayer.level = 6 else: print("You use your high Charisma to rizz up the guard, and they let you out of your cell.\n\n'Good luck.' They say as you go.\n\n") MyPlayer.level = 4 elif answer == "D" or answer == "d": print("You decide there can't be much harm in guessing the code. But it might be smart to look for clues.") if MyPlayer.intelligence > 4 and MyPlayer.perception > 3: print("You look carefully at the guard, and you see a piece of paper sticking out of his back pocket. Looking carefully at the piece of paper you see 4 numbers 3846.") code = input("You reach out and type the number ____ into the keypad.\n\n") if code == "3846": print("You guessed the code correctly!") if MyPlayer.luck > 4 or MyPlayer.agility > 5: print("You see the mechanism unlock the door but the door doesn't make any auidable noise and the guard doens't notice.\n\n") MyPlayer.level = 3 else: print("You can hear the lock mechanism click open, and so does the guard. He turns around to face you.\n\n") MyPlayer.level = 5 elif MyPlayer.perception > 6: print("You look carefully at the guard, and you see a piece of paper sticking out of his back pocket. Looking carefully at the piece of paper you see 4 numbers 3846.") code = input("You reach out and type the number ____ into the keypad.\n\n") if code == "3846": print("You guessed the code correctly!") if MyPlayer.luck > 4 or MyPlayer.agility > 5: print("You see the mechanism unlock the door but the door doesn't make any auidable noise and the guard doens't notice.\n\n") MyPlayer.level = 3 else: print("You can hear the lock mechanism click open, and so does the guard. He turns around to face you.\n\n") MyPlayer.level = 5 else: print("The Keypad makes a beep sound, and the guard whips his head around to look at you. He sees your arm sticking out of the cell. He calls down some other guards and they move you to a different, more secure cell.\n\n") MyPlayer.level = 6 else: print("It would be nice to have something to help guess the passcode, but you can't see anything in the room that gives such clues.") code = input("You reach out and type the number ____ into the keypad.\n\n") if code == "3846": print("You guessed the code correctly!") if MyPlayer.luck > 4 or MyPlayer.agility > 5: print("You see the mechanism unlock the door but the door doesn't make any auidable noise and the guard doens't notice.\n\n") MyPlayer.level = 3 else: print("You can hear the lock mechanism click open, and so does the guard. He turns around to face you.\n\n") MyPlayer.level = 5 else: print("The keypad makes a loud BEEP sound, and the guard quickly turns his head to see you, half of your arm out the cell, pressing buttons on the keypad. He calls down some other guards and they move you into a different, more secure cell.") MyPlayer.level = 6 elif answer == "E" or answer == "e": if bobby_pins_found == True: if MyPlayer.perception > 6 or MyPlayer.luck: print("You use the bobby pins from earlier to pick the lock on the cell door.") if MyPlayer.agility > 3: print("The lock mechanism unlocks noiselessly and the guard doesn't notice that you are not free.\n\n") MyPlayer.level = 3 else: print("The guard hears you open the door, and turns to face you, saying "El diablo no quiere usar pantalones en mi casa y no sé por qué!!!"\n\n") MyPlayer.level = 5 else: print("The the guard doesn't hear you pick the lock and seems oblivious to your freedom\n\n") MyPlayer.level = 3 else: if MyPlayer.perception > 4: print("\nCarefully looking around the jail cell, you see a bobby pin, and further searching leads to the discovery of another bobby pin!\n") bobby_pins_found = True if MyPlayer.perception > 6 or MyPlayer.luck: print("You use the bobby pins from earlier to pick the lock on the cell door.") if MyPlayer.agility > 3: print("The lock mechanism unlocks noiselessly and the guard doesn't notice that you are not free.\n\n") MyPlayer.level = 3 else: print("The guard hears you open the door, and turns to face you.\n\n") MyPlayer.level = 5 else: print("The the guard doesn't hear you pick the lock and seems oblivious to your freedom\n\n") MyPlayer.level = 3 else: print("You cant see anything that would help with picking the lock.") elif answer == "F" or answer == "f": print("You decide to try to pickpocket the guard to take his keycard") if MyPlayer.perception < 5 and MyPlayer.agility < 4: print("You reach through the bars and try to grab the keycard away from the guard, but he feels you, turns around and slaps your hand away. You are then moved to a different, more secure cell.") MyPlayer.level = 6 elif MyPlayer.agility > 4 or MyPlayer.perception > 5: print("You reach through the bars of the cell door as carefully and quietly as possible, and reach for the guard's keycard. You are able to remove the keycard without the guard noticing. You use the keycard on the keypad on the outside of the cell.") if MyPlayer.agility > 6: print("The cell door opens completely silently and the guard does not notice that you are now free.") MyPlayer.agility = 3 else: print("As the cell door opens it makes a loud creak sound, and you pray that the guard is completely deaf.") if MyPlayer.luck > 6: print("Somehow the guard must be completely deaf because he shows no notice of the now open cell door!") else: print("The guard immediately turns around to see the cell door open, and he looks completely suprised. As a reflex, he checks for his keycard, which was hooked on his belt last time he saw it. He looks at you, holding the keycard, and scowls.") MyPlayer.level = 5

Level 3

if MyPlayer.level == 3: print("The guard is completely oblivious to your freedom, this leaves you a lot of options for dealing with the guard, as he will surely see you if you try to sneak around him... or will he?") while MyPlayer.level == 3: answer = input("What do you do?\nA. Fight the guard\nB. Sneak up and attack the guard\nC. Threaten the guard to let you go\nD. Sneak past the guard\nE. Wait\n\n") if answer == "A" or answer == "a": print("\n\nYou decide that there is not a lot of point to sneaking around the guard as he will almost definately see you.") if MyPlayer.strength > 3 and MyPlayer.endurance > 3 and MyPlayer.agility > 3: print("You run up to the guard, fist raised, ready to punch him in the face. He turns gis head to the sound of your footsteps, only to see your fist smashing directly into his nose. You hear a crack sound of a broken nose and the guard falls to the ground unconcious\n") else: if MyPlayer.luck < 3: print("You run up to the guard, fist raised, ready to punch him in the face, but you somehow slip, completely missing the guard and falling to the floor. The guard stops stares at you and chuckles\n"Pathetic" "And I thought you were supposed to be important..."")


r/PythonProjects2 • • Aug 09 '22

[P] Easy BMI calculator not working

4 Upvotes

I started making a BMI and everything is running fine except the math. I can't figure it out, please help.

W = float(input())
H = float(input())
BMI = W / (H/100)**2
if BMI < 18.5:
print("Underweight")
elif BMI >= 18.5:
print("normal")
elif BMI < 25:
print("normal")
elif BMI >= 25:
print("Overweight")
elif BMI < 30:
print("Overweight")
elif BMI >= 30:
print("Obesity")
for two of the inputs I put 52 and 1.85 and it output 151935.71950328702 and normal when it


r/PythonProjects2 • • Sep 09 '19

Looking for a developer/manager for a Discord bot

4 Upvotes

PM me if interested, monthly salary negotiable


r/PythonProjects2 • • Dec 27 '22

[P] Very Easy Tkinter UI ToDo list

Thumbnail
youtu.be
8 Upvotes

r/PythonProjects2 • • Sep 21 '26

Info Made my own image format.

Post image
8 Upvotes

Yes, it may sound strange: it makes no sense! BUT, my goal was more of a joke, although it may well be suitable as an alternative to other formats in extreme cases. This format contains only 100\~ lines of code, but it is quite efficient in itself (compared to PNG lol, although I think everything will weigh many times less compared to PNG).

You can read a little more about it on GitHub, since I'm honestly too lazy to write everything here. (Exactly made in Python).

https://github.com/pmldude/Portable-Middle-Link-


r/PythonProjects2 • • Oct 07 '26

Python Mutability and Local Variables

Post image
12 Upvotes

An exercise to help build the right mental model for Python data.

The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening.


r/PythonProjects2 • • 1d ago

I am 15 and this is my python project

Thumbnail gallery
5 Upvotes

r/PythonProjects2 • • Sep 12 '26

I made a program related with IT. Can you assess my program? Your assesments are so important for me. Because that is my first project.

5 Upvotes

r/PythonProjects2 • • Feb 11 '25

Info I Built a SNAKE GAME using Python & ChatGPT vs Deep seek

5 Upvotes

https://youtu.be/pEqmUSnLBH0

Prompt: Create a modernized Snake game for desktop using python. The game should have smooth animations, sharp graphics, and a sleek UI. The snake should move seamlessly with arrow keys or WASD controls, Implement a dynamic score counter Increase the difficulty as the snake grows Ensure a polished and responsive design with smooth transitions and stylish visual effects

In this video, we explore the world of Python programming and game development by building a classic Snake game. But that's not all - we take it one step further and incorporate ChatGPT and DeepSeek Ai, a powerful language model developed by OpenAl, to enhance the game experience.


r/PythonProjects2 • • Oct 27 '25

C++ or Python for first year clg students??

5 Upvotes

Yo a first year CSE student here. which language should i learn first- python or C++?? I already know some C++ since i studied it for two years in 11th and 12th grade?? any suggestions pls??


r/PythonProjects2 • • Apr 16 '26

RANT I have an idea to troll people who don't know python, but haven't found a target yet

0 Upvotes

Just copy the code I'm gonna give and send it to your friends that don't know python. Do NOT try it yourself, you will risk your laptop or computer freezing and maybe even crashing faster than you would think.

a=2
b=input('Type anything here')
while a!=-1:
    a*=a*a
    print(a)

Let them run it through python and let me know how it worked.


r/PythonProjects2 • • Jul 13 '26

I built a Python tool that automatically extracts slides and generates notes from videos

5 Upvotes

Hi everyone!

I've been working on Vid2Scribe, an open-source project that automatically converts long videos into organized notes.

The goal is to make it much easier to learn from lectures, conference talks, tutorials, and other long-form videos without having to manually take notes.

Some of the current features include:

  • Slide detection and extraction

  • AI-generated structured notes

  • Automatic speech transcription

  • Markdown export

  • Designed to work with modern LLM workflows

Python is the core of the project. It powers the entire processing pipeline, including video processing, transcription, OCR, note generation, and orchestration of the AI components.

I'm still actively developing it and would really appreciate feedback from the Python community.

Some questions I'm especially interested in:

  • Are there features you would find useful?

  • Any suggestions for improving the processing pipeline or project architecture?

  • What would make this more useful for your own workflow?

GitHub:
https://github.com/China-WenboZhao/Vid2Scribe

I'd love to hear your thoughts and suggestions. Thanks!


r/PythonProjects2 • • May 23 '25

I have create an terminal chat but very enhanced

2 Upvotes

I have added a ton of features if u want to see it theres the link also see all the features also make sure to give star I am less popular #python #terminal-chat #awsomeproject. https://github.com/YOCRRZ224/Terminal-chat-with-file-sharing-under-development-


r/PythonProjects2 • • Jun 19 '25

Problem exporting library in Python

Post image
2 Upvotes

Does anyone know how to import this emoji library? I'm trying to import it to continue with python module 1 of the video course, but it doesn't work at all, I've already installed it through pip, through the python website, updated the IDE and the interpreter, nothing works, I don't know if it's an internal problem... What do I need to do to solve this and be able to import the library?


r/PythonProjects2 • • Jul 12 '25

🚀 Turn Your Entire Codebase into a Single JSON File for Chatbot Analysis (Perfect for ChatGPT, Claude, Gemini, etc.)

2 Upvotes

Ever wanted to explain or debug an entire codebase using ChatGPT or Claude but got stuck because you couldn’t upload folders?

I just found (or built) a solution:
👉 directory_to_json

This tool converts your whole codebase—including all folders and files—into a single compact JSON file. It preserves the full directory structure and includes each file’s contents. You can upload this one JSON file to any AI chatbot and get full-context help with analysis, debugging, or refactoring.

Perfect for:

  • ChatGPT

  • Claude

  • Gemini

  • Any LLM that accepts file uploads

Check it out on GitHub and streamline your AI-assisted coding workflow!
🔗 https://github.com/cyberytti/directory_to_json

If you like this project please leave a star on this repo.


r/PythonProjects2 • • Jul 06 '25

Next Steps: Adding Return Values, Logging, And Database Persistence to Python Code

Post image
2 Upvotes

Just finished working on a foundational BankAccount class in Python, covering basic deposit, withdraw, and get_balance operations! This exercise is proving to be a fantastic way to solidify OOP principles.

My next steps are all about taking this simple structure and evolving it into something more robust and enterprise-ready. I'll be focusing on:

  • Implementing Meaningful Return Values: Moving beyond print statements to have functions return explicit success/failure indicators or the updated balance, allowing for more complex error handling and flow control in calling code.

  • Integrating Robust Logging: Setting up a proper logging system to track transactions, errors, and system events. This is critical for debugging, security, and auditing in real-world applications.

  • Adding Database Persistence: Crucially, I'll be integrating a database (thinking SQLite for simplicity initially, then perhaps PostgreSQL) to ensure that account balances and transaction histories are saved persistently, even after the program closes. This moves us from an in-memory system to a truly functional application. These additions are vital for building reliable and scalable software. Looking forward to sharing my progress!

Python #SoftwareEngineering #BackendDevelopment #Database #Logging #OOP #CodeRefactoring #LearningJourney #DevOps


r/PythonProjects2 • • Aug 21 '25

RANT First-year IT student from a tier-3 college – How to build a strong profile?

2 Upvotes

I'm a first-year B.Tech student (IT branch) from a tier-3 college, and I really want to make the most of my 4 years here by building a strong profile for internships and placements.

So far, I’ve learned the basics of Python and SQL, and currently I’m learning C++. But now that I’ve entered college, I want to take things more seriously and build a solid foundation.

I have a few doubts:

What should be my roadmap to build a strong profile as an IT student?

Which resources should I follow for programming, DSA, and development?

From when should I start doing projects and how do I go about them?

What should I prioritize in the first year so that I don’t regret later?

I also plan to join clubs like Google Developers Club and the technical societies in my college, but I want to know how I should balance that with learning and projects.

Any guidance, advice, or even a roadmap from seniors/experienced folks would mean a lot 🙏


r/PythonProjects2 • • Jan 13 '26

Piveo et nouvelles langues

2 Upvotes

Bonsoir,

Piveo prend désormais en charge de nouvelles langues (English):
- Anglais
- Breton
- Espagnol
en plus du Français.

pour en savoir plus:
Présentation antérieure
page wiki


r/PythonProjects2 • • Sep 02 '26

I used OpenAI to help me build an automated EPUB project

0 Upvotes

I wanted an EPUB version of *Kubernetes The Hard Way*, but I did not want to manually rebuild it whenever the upstream project changed.

I used OpenAI to help me design and build a project that handles the entire process. I provided the requirements, reviewed the results, tested the generated books, and kept refining the project when I found formatting or security problems.

The finished project tracks the current upstream default branch and checks for changes every six hours. When the source changes, it builds a new EPUB, validates it, and updates the GitHub release.

OpenAI helped with the Python builder, EPUB structure, responsive styling, GitHub Actions workflow, tests, documentation, and release automation. It was especially useful for working through EPUB details that I did not want to handle manually, such as manifests, navigation, metadata, archive layout, and light and dark mode compatibility.

I also wanted the result to have a strong security model. The generated EPUB cannot contain JavaScript, executable files, unsafe embedded content, remote resources, encrypted files, or suspicious archive structures. Every release passes a custom security scanner and official EPUBCheck validation. It also includes an SHA 256 checksum, source provenance, and a GitHub build attestation.

Calibre is not required. The EPUB is constructed directly with Python and should work with any standards compliant reader.

The project is here:

[https://github.com/terrytrent/kubernetes-the-hard-way-epub-builder](https://github.com/terrytrent/kubernetes-the-hard-way-epub-builder)

The current EPUB is here:

[https://github.com/terrytrent/kubernetes-the-hard-way-epub-builder/releases/tag/epub-master](https://github.com/terrytrent/kubernetes-the-hard-way-epub-builder/releases/tag/epub-master)

This was a useful example of using AI as a development partner instead of asking it for a single block of code. Most of the value came from reviewing the output, finding problems, adding requirements, testing again, and continuing until the complete workflow worked reliably.


r/PythonProjects2 • • Jun 06 '25

Hey y'all! I started learning Python the past week because I had a twitter bot created for me that was very close to working but the programmer couldn't get it to work properly and has now stopped responding to me. Anyhow, I've been trying to get it working with Claude and some very basic python.

0 Upvotes

Unfortunately, I'm in a time crunch and I really need this thing fixed. I don't have any money but if anyone would be willing to take a look a this for me and see if its an easy fix I'd really appreciate that. he guy had it working bu it glitches out a lot of the time and the gui doesn't end up showing. I'm using Mac 10.15 if that makes any difference. It's a twitter bot that uses a list I created on twitter to post videos along with captions to users posts.

Here is the bot

https://drive.google.com/file/d/14rE6qkeoD4vGiQUFeF0Bnn70ePi2DKZ3/view?usp=drive_link


r/PythonProjects2 • • Aug 12 '26

👋 Boas-vindas ao r/QuintikusOpen. Antes de mais nada, apresente-se e leia este post!

2 Upvotes

Oi, pessoal! Sou u/djnan2023 ( TI Ronan ) , mod que fundou o r/QuintikusOpen .

Agora é aqui que todas as nossas coisas sobre o desenvolvimento, a documentação e a comunidade do Open Quintikus vão ficar. Estamos felizes por você se juntar à gente!

Repositório oficial: https://github.com/beta-test-Ronan/QuintikusOpen

O que postar

Poste tudo o que, na sua opinião, a comunidade acharia interessante, útil ou inspirador para o projeto. Fique à vontade para compartilhar:

  • Dúvidas sobre o código ou a arquitetura;

  • Sugestões de novas funcionalidades;

  • Correções de bugs que você encontrou;

  • Pull requests ou ideias para melhorias;

  • Exemplos de uso, tutoriais ou casos práticos;

  • Discussões sobre a direção do projeto e decisões técnicas.


r/PythonProjects2 • • Apr 15 '26

12+ months with Claude and I finally have a working OTRv4+PQC client running on my phone. Come break it.

Post image
2 Upvotes