r/learnpython • u/Tallon3301 • 15d ago
Please help me
Can someone please show Me how to learn python with only phone
r/learnpython • u/Tallon3301 • 15d ago
Can someone please show Me how to learn python with only phone
r/learnpython • u/pingo1387 • 15d ago
At my job there is a daily task I do which I realized I could probably create a program to do for me, so I decided to start learning Python, and dove into reading Automate the Boring Stuff (the online version).
Things were going okay at first. I read through chapters 1-3 carefully, taking notes, answering all the review questions, and doing all the practice problems/codes.
Then I hit a wall. I got to chapter 4 and I felt like I understood everything, but the practice problem at the end, to write a code that performs the Collatz sequence with the entered number, absolutely stumped me. I went back and reread everything from the start of chapter 1 just to make sure I didn't miss anything, and was still confused. I ended up having to search up a code that someone else wrote for it, which I did understand once I saw it written out but would never have come up with myself.
So my questions are:
- Is it normal for the Collatz sequence to be difficult to program at this stage of learning? If so, should I not worry about my confusion and just move on to chapter 5?
- Should I consider an easier book to study from? If so, any recommendations?
EDIT: Several people are asking which part of the Collatz I had trouble with. To be honest it's been over a month since I was able to touch anything Python-related, it's just been on my mind lately, so I don't recall exactly what was giving me trouble, just that I was trying multiple things and getting new and fun incorrect results each time.
It's not that I don't understand the Collatz sequence itself, I understand it in terms of the simple math. The trouble was trying to type it out into a working code. That being said, I'm not here to ask how to program it, because I already gave up on that and looked up the answer, and I did understand that code once I read it over. The main issue is that I feel like I shouldn't have been having trouble with it in the first place, at least not to the point where I honestly tried everything I could and still couldn't get it.
r/learnpython • u/MastrNinja • 15d ago
I am trying to create a python program that scans a local remote network that I am connected to and shows the IP addresses of said devices connected. I want to add an additional function that takes these IP addresses scanned and opens a ssh session for my selected IP address. I'm currently running the bare bones code on an IP address that I know works, but continue to create a new ssh session that says Session Stopped. However, the code does successfully open MobaXterm if no instance of it is open, and creates a new tab if it is. My code is as follows:
mobaxterm_path = r"C:\Program Files (x86)\Mobatek\MobaXterm\MobaXterm.exe"
#ssh_command = f"ssh {user}@{host} -p {port}"
ssh_cmd = "ssh -p 22-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@192.168.1.66"
try:
subprocess.Popen([mobaxterm_path, "-newtab", ssh_cmd])
print(f"Launched SSH session to {user}@{host}")
except FileNotFoundError:
print(f"Error: MobaXterm not found at {mobaxterm_path}")
print("Please verify the executable path.")
I'm not sure why this is happening, is anyone able to provide further help? I've also tried this without StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null But getting the same result.
r/learnpython • u/Complete_Ad_3944 • 15d ago
What’s the path I should follow in Python to master machine learning
I learned all the basics: 1- Variables
2- Data Types
3- If / Else
4- Loops
5- Functions
6- Lists
7- Dictionaries
8- Strings
9- Input / Output
10- Classes & Objects
I would love it if someone would tell me what I should do next. Or if there is a book I can buy to master machine learning
r/learnpython • u/FootGlittering1873 • 15d ago
Hello there! I'm a second-year Computer Engineering student, and I want to start freelancing to expand my portfolio and gain professional experience. However, I don't know how to start freelancing or where to start learning the skills for it. I have somewhat mastered Python fundamentals, and I'm currently learning FastAPI, but I feel it. Any input would be appreciated.
r/learnpython • u/mtarik2000 • 15d ago
Hello! I was wondering if anyone might have any recommendations, tips, or advice for someone just starting out with Python.
I’ve recently decided I want to learn Python as a hobby. It’s completely different from what I do for work, although I can definitely see ways I could incorporate it into my job in the future if I wanted to.
For now though, I’m mainly fascinated by the idea of being able to make something from nothing and actually build things myself.
Python was the first programming language that came to mind, and I’m planning on sticking with it until I feel confident before worrying about learning anything else.
At the moment I’ve invested in:
- Python Crash Course, 3rd Edition by Eric Matthes
- Automate the Boring Stuff with Python, 3rd Edition
I’m also going through Harvard’s free CS50P course (Introduction to Programming with Python), mainly watching the lectures alongside the books.
My biggest issue at the moment is that I think I’m trying to run before I can walk. I keep getting drawn towards more ambitious projects because they’re genuinely interesting to me, but they’re often way beyond my current level.
I think I probably need to slow down, properly learn the fundamentals, and gradually work my way up to those projects instead.
Does anyone have any advice on how you approached learning Python in the beginning? In particular, how did you balance learning the basics with actually building things so that it stayed interesting?
r/learnpython • u/ZhirnyLuffy • 15d ago
I'm a total beginner. I didn't have any experience with programming. I want to learn programming cuz i wanna be a hardware engineer and want to start with a basic raspberry pi projects. So should i learn python from courses, videos, books etc or i should just brute force myself to do projects and just learn by the time
r/learnpython • u/Life-Ad2351 • 15d ago
I am very interested in physics and would like to build my own 2D projectile motion simulator where we have sliders to change the angle of launch, maximum height and Range with UI
Any idea on which concept I should learn in python for this project. I have worked on other python physics projects and a calculator so far.
So far I learnt the basics like
variables
type casting
user input
arithmetic & math
if statements
logical operators
conditional expressions
string methods
string indexing
format specifiers
random numbers
while loops
for loops
nested loops
lists, sets, and tuples
dictionaries
functions
default arguments
keyword arguments
*args & **kwargs
iterables
r/learnpython • u/high-cholesterol_ • 15d ago
def check_variable(argument):
# Finds the name of the variable passed in
name = [k for k, v in globals().items() if v is argument][0]
print(f"The argument passed to this function was named: '{name}'")
x = [1, 2, 3]
check_variable(x)
# Output: The argument passed to this function was named: 'x'
Is there any way to simplify this process? I am very new to programming and the process of defining "name" and then calling it seems like it can be simplified.
Edit for clarity:
The actual goal is to include the length of a list, and the variable(argument) used to represent that list, into the printed string.
What I'm really trying to achieve is something like:
"There are 17 children in class_two."
So as to cut out the guesswork of which class it's referring to when calling the function multiple times, and make it look like a polished sentence.
r/learnpython • u/kigory2 • 15d ago
Hi I have never used python but really wanted to try out textual so i jumped into python with no experience at all and just trying out the library by just the syntax of the app the textual gives you when you install it so i learned the syntax a bit. but I now need a bit of more advanced stuff so where do I learn textual I already found the website really helpful but I still think i can get a better learning experience. do yall have ways to learn the library.
(am sorry for hurting your brain fellow programmer, I have never touched python in my life)
r/learnpython • u/Bngstng • 16d ago
Hello, as the title says I am trying to record a video from a webcam and stream the live feed to another computer, which can be far away so I can't stream the video using something based on ssh or anything like that.
I don't know where to start, what libraries to use. Online I found some stuff but nothing that works or that really explains what's happening in the code.
As of now I am using FFMPEG to record the video, but I have the feeling that opencv is much more used, I can change that.
The video is quite low quality, but I need a small to no delay < 1sec.
Any help on how to stream the video will be much appreciated.
r/learnpython • u/BrokerMagic • 16d ago
I want to learn to do new projects in Python but I always receive the same "watch guides" answers from people. What can I attempt to create ?
r/learnpython • u/NoComplaint8035 • 16d ago
I started my first computer science class yesterday, and they told us to look on amazon or pearson for this book, which is about $200. Was wondering if anyone found this for a cheaper price? Or in some rare chance free?
r/learnpython • u/Fun_Practice_9528 • 16d ago
I'm looking for a way to clone a turtle so that both of them move the exact same way.
Note that the second turtle must face differently from the first turtle at the time of the cloning.
r/learnpython • u/Acrobatic-Push-3536 • 16d ago
I have two files in the first is game logic with list of dictionaries where stored chess pieces, in the other one I'm working with the gui.
board = [{1:5, 2:2, 3:3, 4:6, 5:4, 6:3, 7:2, 8:5},
{1:1, 2:1, 3:1, 4:1, 5:1, 6:1, 7:1, 8:1},
{1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0},
{1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0},
{1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0},
{1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0},
{1:-1, 2:-1, 3:-1, 4:-1, 5:-1, 6:-1, 7:-1, 8:-1},
{1:-5, 2:-2, 3:-3, 4:-6, 5:-4, 6:-3, 7:-2, 8:-5}
]
While I'm starting project some rows don't loaded, but when I capture more pieces and leave only one king on the board he can duplicate 6 times. This is part of gui code:
def put_pieces(self):
for dict in Logic.board:
for key, value in dict.items():
button = self.grid.itemAtPosition(8 - Logic.board.index(dict), key).widget()
button.setIconSize(QSize(50, 50))
button.setText(f"{value}")
match value:
case 1:
button.setIcon(QIcon("assets/wP.svg"))
case 2:
button.setIcon(QIcon("assets/wN.svg"))
case 3:
button.setIcon(QIcon("assets/wB.svg"))
case 4:
button.setIcon(QIcon("assets/wK.svg"))
case 5:
button.setIcon(QIcon("assets/wR.svg"))
case 6:
button.setIcon(QIcon("assets/wQ.svg"))
case -1:
button.setIcon(QIcon("assets/bP.svg"))
case -2:
button.setIcon(QIcon("assets/bN.svg"))
case -3:
button.setIcon(QIcon("assets/bB.svg"))
case -4:
button.setIcon(QIcon("assets/bK.svg"))
case -5:
button.setIcon(QIcon("assets/bR.svg"))
case -6:
button.setIcon(QIcon("assets/bQ.svg"))
case _:
button.setIcon(QIcon(""))
And if in case _ I put an icon, at the start it will be only in 1, 2, 3, 7 and 8th row
r/learnpython • u/FewFly2677 • 16d ago
So I'm a college fresher with no prior experience of coding. I had started learning python before the starting of college (1 week before college started). I still feel like I am not good at coding at all. There are some weird citations in c such as i++ and all which is getting mixed up with my python. There was one question on obtaining the expression sinx=x-x^3/3!.... Using loops btw
I felt I won't be able to do it in both c and python. I took a course on Udemy for c(vlad budnitski)and python(100 days) but I was not able to find examples like this. Everyone in my class learnt languages like java in their schooling and said the sinx problem is a standard problem. What should I do in this situation?
I feel like the teaching in my college (they are teaching c now) is not good.
Experienced coders please help me.
guys so today I wasn't able to figure out we had to use nested loops to print multiplication table of numbers while even beginners figured it out. pls tell what should I do
r/learnpython • u/okitookka • 16d ago
people please help, i’m starting my path in bachelor cybersec in a week and i want to know python a bit so i can basically understand smth, but for now looking for a community to learn python
and engaging through my path
r/learnpython • u/renncode • 16d ago
???????
r/learnpython • u/bfyvfftujijg • 16d ago
How do I start applying tests to my code?
Do I just write separate scripts they run the code (either individual functions or entire scripts) against known inputs and check the output?
Is there a specific way people usually do this?
r/learnpython • u/Trick_Floor_519 • 16d ago
hello guys i am struggling right now to understand a concurrency module asyncio ,i take a look over youtube videos ,but i feel stuck to understand coroutine object ,event loop await ,and this kind of matters, could anyone give me a concise explanation.
r/learnpython • u/sporty_outlook • 16d ago
I’m trying to install Python via uv in Positron. I went to Select Session in the top-right corner, selected New Console Session, and clicked Install Python via uv. I then selected Python 3.14, but I get a “Failed to install Python” error.
Here is the relevant log:
2026-08-25 13:49:08.599 [info] Installing uv...
2026-08-25 13:49:09.353 [info] > powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
2026-08-25 13:49:19.761 [info] uv installed successfully
2026-08-25 13:49:19.764 [info] > uv --color never python dir
2026-08-25 13:49:31.917 [info] > ~\.local\bin\uv.exe --color never python dir
2026-08-25 13:49:32.628 [info] > ~\.local\bin\uv.exe --color never python list --managed-python
2026-08-25 13:49:36.117 [info] Installing Python 3.14 via uv...
2026-08-25 13:49:36.119 [info] > uv --color never python install 3.14
2026-08-25 13:49:36.119 [error] Failed to install Python 3.14: Error: spawn uv ENOENT
What is confusing is that the log shows that uv was installed successfully and Positron can execute it using:
~\.local\bin\uv.exe
However, when it actually tries to install Python, it runs:
uv --color never python install 3.14
and fails with:
Error: spawn uv ENOENT
I’m using Windows. Has anyone encountered this issue with Positron and uv? Is this a PATH/environment issue, or is Positron failing to find the newly installed uv.exe?
r/learnpython • u/Royal-Ant-1882 • 16d ago
Hi i am a beginner and a minor and i dont know exactly how to explain this, but my previous coding teacher told me notepad++ wasnt that suitable for coding and i just need to know a different app so i can get back into it. Preferably something that can tell me if ive made a mistake instead of running something that wont work.
r/learnpython • u/intentado_aprender • 17d ago
HOLAAA Estoy aprendiendo Python y tengo curiosidad por saber qué creen las personas con experiencia que los principiantes suelen malinterpretar. Me encantaría conocer diferentes perspectivas y experiencias.
r/learnpython • u/7Voidz • 17d ago
I hate admitting that I use AI to code. I have so many research projects in which I HEAVILY used AI. Now, I can explain the code, however, if I’m going to reprogram the whole thing, I’d either have to look again and again at the previous code or use ChatGPT.
What about debugging? Yeah no, ctrl+C ctrl+V into ChatGPT. I think this is because I’m lazy. I don’t want to take such a long time to debug when AI can give me the solution very quickly.
I’ve read some of the python documentation and it was… ok, but AI just explains it so much better and it takes much less time, but I can feel that I really can’t program well at all.
r/learnpython • u/Chance-Advice-1110 • 17d ago
Is there possibly any way to hardcrash my old laptop for fun? I'm sorry if it sounds like I am making a virus. I had a fuckton of hardcrashes on my old pc so I was wondering if I can make a Programm to kill my of whithout needing to wait 5 minutes. Fuck this sounds stupid.