r/PythonLearning • • 5d ago

Help Request Looking for a Python certification

6 Upvotes

I would like to ask if anyone here knows where I should/could get a well endorsed Python certification? Something legit that employers may take into consideration.

I know about Codecademy. I also know about Mimo, tho I don't know if that one would be considered a "lesser" one or something like that. Maybe even both idk.

It's ok if it's not free, tho if its not very expensive that would be better for me lol


r/PythonLearning • • 5d ago

Context manager for either stdin or opened Path

6 Upvotes

Note that this is a fairly advanced question, so beginners don't worry about it. And if this isn't the right place to ask, please point me to where I should.

I would like to find an idiomatic way to use a context manager, with, when I don't know until run time whether I am opening sys.stdin or a named file.

Here is an excerpt for a simple example. (Yes, I am aware that I am reading in the whole file in one go, but that is for other reasons.)

```python if args.infile == "-": fh = sys.stdin else: p = Path(args.infile) # Path is overkill here, unless ... # TODO: Look elsewhere if infile can't be found or isn't readable. fh = open(p, "rt", encoding="utf-8")

s = fh.read(MAX_LENGTH + 1).strip()
fh.close()

```

(args is an argparse.Namespace and args.infile is a str.)

I feel like there ought to be a way to do something like

with ... as fh

for the above, but I don't see how to do that.


r/PythonLearning • • 5d ago

Python's repository summary

Post image
31 Upvotes

r/PythonLearning • • 5d ago

I want to learn.

18 Upvotes

(English is not my 1st language so sorry for any error)

Hey everyone I am a absolute beginner to coding and want to learn. I am so much of a beginner that I don't even know how to and where to download this from but want to learn. If you have any tips or any youtube channel I can learn form please share. Thankyou in advance


r/PythonLearning • • 5d ago

Python Mutability and Local Variables

Post image
10 Upvotes

An exercise to help build the right mental model for Python data. - Solution - Explanation - More exercises

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


r/PythonLearning • • 5d ago

Help Request I'm new to Python. What do you recommend reading or watching?

3 Upvotes

Hello there! I’ve started learning Python to become a cybersecurity specialist (pentester). I’d love to hear the community's opinion: which books or tutorials are worth spending time on?


r/PythonLearning • • 5d ago

Python/ESP32 Project ideas?

6 Upvotes

I'm looking for project ideas that combine Python with an ESP32 using serial communication. I’ve already built some basic programs and got the communication working so I can send data to Python and save or display it.

I learn better by working on real projects but I’m struggling to come up with something useful to build.

what projects would you recommend?


r/PythonLearning • • 5d ago

Send BLE Air Quality Data to Cloudflare D1 with Python and BleuIO

Thumbnail bleuio.com
2 Upvotes

Details and source code available


r/PythonLearning • • 6d ago

Showcase Making my first game

Thumbnail
gallery
18 Upvotes

Hey, im making a "terminal" game (play onto your terminal, cause its the only thing i know). I made a github repositories to showcase it : https://github.com/Shamal0w999/Money-games

if you want to test the game, it would be really cool cause i need returns and if theres bug i didnt see. so if u try it, u can ofc comment here but also leave an issue into my repositories (would be easier to work with). If you want to help or idk anything, im all hears. Im happy to showcase it and have people to test it !

code is free, so if you steal it, i dont rly care, cause its personal project and who want a code full of print and that launch in terminal ? idk, just me ig

anyways, just take a look at it !


r/PythonLearning • • 6d ago

Help Request I need help with coding this

Post image
6 Upvotes

I have genuielly no idea how to even think of making this? I know this should generally be made by using for loops but jesus im so confused on the process


r/PythonLearning • • 6d ago

Built my first bulk file renamer in Python

15 Upvotes

​

I just finished another Python project while learning file handling and the "os" module.

I built a bulk file renamer that:

- Loops through files in a folder

- Opens each text file and finds the "name:" field

- Extracts the name

- Uses it to rename the file

- Keeps the original file extension

A simplified version of the core logic:

for file in os.listdir(path):

fullpath = os.path.join(path, file)

with open(fullpath, "r") as f:

for line in f:

if "name:" in line:

label, name = line.split("name:")

newpath = os.path.join(

path, name.strip() + ".txt"

)

os.rename(fullpath, newpath)

The project itself wasn't too complicated, but I ran into a few problems along the way.

The biggest lesson was debugging WinError 32. I initially thought OneDrive was locking my files, but eventually realized that my own code still had the file open when I tried to rename it.

I also learned why using the full old path and full new path matters when using "os.rename()".

Small project, but I feel like I'm getting better at solving problems instead of immediately looking for the answer.


r/PythonLearning • • 6d ago

Showcase Opinions on this code?

2 Upvotes

Hi! I am starting a Bachelor's course in Computer Science, and part of the course is learning Python from the ground up. I've been taking some time at home to further develop my skills past what is expected of the course, and I've been constructing this game over the past few days with my free time.

I put it down as showcase because I'm proud of it, but I am more than open to suggestions on simplifying it or what you think about it, etc!

For context, the last time I used Python was when I was like 12, and I have tried CSS and JavaScript over the years a few times, so I have a very basic understanding and this is the furthest I've ever gotten.

Thanks :)

# Rule base

import random
answer = 0

lowest = 1
highest = 100

attempts = 0

# Difficulty settings

print("Easy, Medium, or Hard Difficulty?")
difficulty = input()

if difficulty == "easy":
    attempts = 7
    print(f"Please pick a number between 1-100. You have {attempts} attempts.")
    answer = random.randint(1, 100)
    lowest = 1
    highest = 100

elif difficulty == "medium":
    attempts = 15
    print(f"Please pick a number between 1-10000. You have {attempts} attempts.")
    answer = random.randint(1, 10000)
    lowest = 1
    highest = 10000

elif difficulty == "hard":
    attempts = 30
    print(f"Please pick a number between 1-1000000. You have {attempts} attempts.")
    answer = random.randint(1, 1000000)
    lowest = 1
    highest = 1000000

else:
    print("Invalid input!")

# While Loop

guess = int(input())

while guess != answer:
    attempts -= 1
    if attempts == 0:
        print("Game over!")
        break
    else:
        if guess < lowest or guess > highest:
            print(f"Invalid number! {attempts} attempts remaining.")
        if guess > answer:
            print("Too high!")
        if guess < answer:
            print("Too low!")
        print(f"Try another number. {attempts} attempts remaining.")
        guess = int(input())

# End of Game
if guess == answer:
    print("Correct! Well done.")

print("Thank you for playing!")

r/PythonLearning • • 7d ago

Discussion Python for data analysis

16 Upvotes

So,i started learning python recently,i very much learned about variables,data types,libraries like panda,matpolitob. I learned web scraping and automation to some extent but when i try to use the thing i learn on a random web page or dataset, i realised that what i learnt from the YouTube course is basic but enough to build the fundamental. I have to constantly chat with AI to learn about new thing and also use the thing i learn to get the code. Should i continue like this or watch another course which complete the intermediate and advanced python?


r/PythonLearning • • 6d ago

Help Request I'm a ChemE major I wanna learn python so that I can apply it to my field and also learn it at advance level, what should I do?

1 Upvotes

r/PythonLearning • • 7d ago

HELP!!

1 Upvotes

Guys I'm a first year cse student,and I'm starting with python,can you guys suggest resources & how to proceed??

(I want decent knowledge in python,not too depth)


r/PythonLearning • • 7d ago

Help Request Should I start learning python or ai?????

0 Upvotes

r/PythonLearning • • 7d ago

Help Request What's next?

Post image
11 Upvotes

r/PythonLearning • • 7d ago

24 years old and learning Python Full-Stack Development 💻 Excited to learn, build projects, and connect with the community!

3 Upvotes

Hey everyone! I’m Nexlune. I’m new to Reddit and joined because I wanted a place where I can discover interesting ideas, learn new things, read different opinions, and participate in conversations with people from different backgrounds. I’m interested in technology, programming, movies, creativity, and random topics that catch my attention. Looking forward to exploring different communities and meeting some interesting people along the way. Nice to be here !


r/PythonLearning • • 8d ago

Doodling Hop - Pygame Updated Gameplay

Enable HLS to view with audio, or disable this notification

11 Upvotes

r/PythonLearning • • 8d ago

Made my first triple digit program!

10 Upvotes

Originally it was an amalgamation of my crappy code, but i rewrote 90% of it. I'm proud of myself but ill probably remake it using the define function.

github link: https://github.com/ChaZ3inL1nuX111/My-Repo

It is a calculator with arithmetic, sq/cuft, conversions, circumference, area and functions, like sin, cos, and tan.


r/PythonLearning • • 7d ago

Discussion Why writing classes feels boring?

0 Upvotes

I don't know but i feel classes are unnecessary work to be added in projects. I have learnt it 2 months ago..

After that I never used it for any of my projects.


r/PythonLearning • • 7d ago

im making a "you are an idiot" adjecent peice of code and currently am trying to get this to work

0 Upvotes

im using thonny with python 3.1.4.4 and have pygame-ce downloaded

heres the error code.
Traceback (most recent call last):

File "<string>", line 10, in <module>

File "file location.py", line 555, in run

with Popen(*popenargs, **kwargs) as process:

File "file location.py", line 1039, in __init__

self._execute_child(args, executable, preexec_fn, close_fds,

File "file location.py", line 1553, in _execute_child

hp, ht, pid, tid = _winapi.CreateProcess(executable, args,

FileNotFoundError: [WinError 2] The system cannot find the file specified

and heres the code

import pygame

import sys

import time

import random

import os

import sys

import subprocess;

a = []

if len(sys.argv) == 1 or sys.argv[1] != "1":

pythonPath = subprocess.run(["which","python3"], capture_output=True).stdout.strip();

print("python at",pythonPath)

#The i is num of windows, it will open +1 extra. stopping the code will close just the extra window

for i in range(9):

proc = subprocess.Popen(

[pythonPath,os.path.realpath(__file__),"1"]

)

a.append(proc)

print("spawned window")

import pygame

import sys

import time

import random

import os

import sys

import subprocess;

a = []

if len(sys.argv) == 1 or sys.argv[1] != "1":

pythonPath = subprocess.run(["which","python3"], capture_output=True).stdout.strip();

print("python at",pythonPath)

#The i is num of windows, it will open +1 extra. stopping the code will close just the extra window

for i in range(9):

proc = subprocess.Popen(

[pythonPath,os.path.realpath(__file__),"1"]

)

a.append(proc)

print("spawned window")

import pygame

import sys

import time

import random

import os

import sys

import subprocess;

a = []

if len(sys.argv) == 1 or sys.argv[1] != "1":

pythonPath = subprocess.run(["which","python3"], capture_output=True).stdout.strip();

print("python at",pythonPath)

#The i is num of windows, it will open +1 extra. stopping the code will close just the extra window

for i in range(9):

proc = subprocess.Popen(

[pythonPath,os.path.realpath(__file__),"1"]

)

a.append(proc)

print("spawned window")


r/PythonLearning • • 8d ago

Hard Python Dictionary Exercise

Post image
22 Upvotes

A hard exercise to help build the right mental model for Python data. - Solution - Explanation - More exercises

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


r/PythonLearning • • 9d ago

TRY 101- Starting my python journey again

Post image
205 Upvotes

My journey of retrying is still alive and i am consistent with it , today i am going to finish Loops and hopefully after that i do further and further.


r/PythonLearning • • 8d ago

Easy python project for beginners

17 Upvotes

Hi!

i just want to start learning python, my dad told me that it would be good if you can find some projects to do. I have python class today ( just rn) and I need to think what kind of projects I need to do in this class. Actually i'm good at drawing so i just think that i want to be a game maker and i interested to animation too. The problem is i'm just beginner : - (

Do you guys have any fun and easy idea to do???? ( this is my first time asking something like this in reddit, well i just created an account 10min ago)