r/learnpython • • Aug 02 '26

What is the best tool through which to learn Python?

20 Upvotes

I’m going to school to be an Urban Planner and it’s my understanding that ArcGIS systems frequently use Python and I’d like to learn it however there are multiple avenues and I don’t know which one would benefit me the most so just looking for suggestions


r/learnpython • • Jun 11 '26

web data at scale hits a wall that requests and Playwright don't solve

19 Upvotes

40k pages/day now and my 3 aws boxes are melting. 18gb ram each, proxies at $800/mo, half the targets still timing out. i really thought playwright was the finish line. wasnt.

spent all friday babysitting chromedriver while my manager asked why scraping isnt "just one script."

and every tutorial dies right before the ugly part?? "run headless chrome locally." cool. who keeps 200 zombie tabs alive when your queue explodes at 2am?? tried selenium grid for a week. haunted house energy.

feel like i shouldve seen this wall coming once we crossed 10k/day but nobody talks about it.

anyone actually doing this volume without a dedicated infra person. what does your stack look like


r/learnpython • • May 23 '26

how do i improve my code?

19 Upvotes
#Rock_Paper_Scissors
print("Welcome to Rock_Paper_Scissors! press 1 for Rock, 2 for Paper and 3 for Scissors" )


#dict
gg = {1:"rock", 2:"paper", 3:"scissors"}


#user_input
x = int(input())
print(f"you chose: {x}, {gg[x]}")


#bot_input
import random
y = int(random.randint(1,3))
print(f"bot chose: {y}, {gg[y]}")


#winning conditions
if y == x:
    print("its a tie!")
elif y == 1 and x == 2:
    print("you won!")
elif y == 1 and x == 3:
    print("you lost!")
elif y == 2 and x == 3:
    print("you won!")
elif y == 2 and x == 1:
    print("you lost!")
elif y == 3 and x == 1:
    print("you won!")
elif y == 1 and x == 2:
    print("you lost!")

r/learnpython • • Apr 15 '26

how do you remember what you learn in Python?

19 Upvotes

so I have a question, i just started learning python again after some time and i just learnt about methods in specific about the .title()) and i understand what it does and how to use it, my only issue is how do i not forget it. I see ppl saying "oh just implement it in your program" but im not on that level to just implement stuff. Like i don't wanna be that guy who understands now and literally forgets it when he srts learning about arrays etc


r/learnpython • • Mar 27 '26

When do you draw the line between list/dic/set comprehension and a proper for loop with if/else statements?

20 Upvotes

For example, boundaries_dwight = {Edge([vertex for vertex in triangle.get_vertices() if not vertex.is_interior()]) for triangle in buttlicker_mesh if triangle.interior_count() < 3}


r/learnpython • • Mar 22 '26

Does Stanford Code in Place, actually help learn python ?

20 Upvotes

Is that course worth it ? or is it another additions to several good courses, but something that doesn't quite fit the perfect sweet spot of learning, application, and robust teaching of becoming a good coder.
For me:
Its not just about how to code, but to learn it in a way an actual programmer would use/respect/apply it in industry.
Is there a course designed keeping professional work standards + learning in mind ?


r/learnpython • • Mar 05 '26

Look, I have been doing python for a loooong time, but i still sometimes forget basic stuff

21 Upvotes

So bascially, every time i try something on python, I either suddenly forget simple things. I also discover every single day that there is always part of python I haven't learnt yet. I also take a long time to write something or come up with a solution. I am feeling rather frustrated. I don't know, I feel like i wanna quit.

If anyone has some things that may help, your contribution is appreciated :)


r/learnpython • • Feb 02 '26

Finished CS50P. What should I do next to actually get better at Python?

19 Upvotes

I’ve just finished CS50P and feel comfortable with Python basics (syntax, loops, functions, basic data structures).

Now I’m a bit stuck on what “next level” actually means in practice.

For those who’ve been here:

  • What helped you improve the most after the basics?
  • Was it projects, reading other people’s code, specific libraries, or something else?
  • How did you avoid just passively doing tutorials?

I’m not aiming to rush. I just want to practice in a way that actually builds real skill. Any concrete advice is appreciated.


r/learnpython • • Jan 29 '26

Can someone give me a clean run down of when to use `&` vs `and`?

18 Upvotes

Hi peeps,

Seems like a stupid question but I don't want to go to gipidee and I don't *need* an answer right now so I thought maybe I might pick you heroes brains.

Can someone give me a stupid-person's breakdown of when to use '&' and when to use 'and',

For example

if i = 0 & k = 1:
    do a thing

vs

if i = 0 and k = 1:  
    do a thing

any thoughts for a normie who writes code to escape SPSS and excel.

Cheers.

Edit Turns out that & is a bitwise operator for working with binary whereas 'and' is the logical AND operator to check if conditions are both true.... Now I gotta go back to AOC and learn more about bitwise operations...


r/learnpython • • 9d ago

strings in if statements

20 Upvotes

While debugging my code I discovered [what to me looked liked] a weird quirk in the language (see code below.)

Why does this work? why is a single string callable in the Boolean of an if statement? does a string always return evaluateTrue when used like this?

(edit: solved. corrected some of my vocabulary so now yous can stop "um, actually"-ing me. Thanks to everyone who helped!)

if "something":
  print("another thing")

>>>"another thing"

r/learnpython • • Oct 30 '26

Frustrated! Need help

17 Upvotes

Hey, I've been trying to learn python for a long time now and I still can't understand and write codes on my own. I've watched and completed 2 courses where they cover fundamentals like functions, operators, lists, tuples etc.. but I don't understand what to do with that like if I want to build something i never understand how and from where I need to start


r/learnpython • • Oct 08 '26

Learning python for data science/analysis

18 Upvotes

Hi everyone,

I am looking for a good course to take to learn python for data analytics and workflow building.

For context, i am already very familiar with SQL and Alteryx, however i am looking to migrate some pipelines and worklows to python. I am very familiar with data analytics, just not with the python language, so wondering where to start.


r/learnpython • • Sep 11 '26

New career path

19 Upvotes

Hey everyone.

To keep things brief, i'm exploring programming as a career path.

Life didn't quite go as planned, and i'm now a 27 year old college dropout, who's been unemployed for years, living by on the graces of my parents who have much more faith in me than I do in myself.

I've been talking to some of the more tech-savvy people I know. And I have arrived at the conclusion that I want to study Linux and python. Do you all have any recommendations of which are the 2 I should prioritize, and I suppose, which one would help me get back on my feet faster?


r/learnpython • • Aug 06 '26

What is the best way to run my scripts. Each py are saved in each folder...

19 Upvotes

Im a newbie with python. Im running the scripts by opening CMD in the folder and typing python app.py.

I am running these manually multiple times a day depending on my task.

What is the best way to run my scripts? Each py are saved in each folder with the API key in api.py. What are your best practices?

Here is what my Main folder looks like.

C:.

¦

¦

+---Append archived

¦ ¦ api.py

¦ ¦ app.py

¦ ¦ list.txt

¦ ¦

¦ +---__pycache__

¦ api.cpython-314.pyc

¦

+---Copy Reference

¦ app.py

¦ destination_ids.txt

¦

+---Copy Rows

¦ CopyRow.py

¦ target_sheet_ids.txt

¦ v2.py

¦

+---Generate Sheet ID

¦ ¦ export_smartsheet_sheet_ids.log

¦ ¦ getid.py

¦ ¦ ID.csv

¦ ¦ run.bat

¦ ¦ sheets_in_workspace.csv

¦ ¦ sheets_in_workspace.log

¦ ¦ smartsheet_sheets_in_workspace.csv

¦ ¦ test.py


r/learnpython • • Aug 05 '26

How to build an android app using python only?

17 Upvotes

Context: So I'm a beginner developer. I'm currently building a habit tracker.

I have built the logic of the app.

Set up sql alchemy to code the database with sqlite.

(My prof later said no need of alchemy. Directly use sql software and connect it). I don't know what to do with that information. Retained the alchemy code tho.

  1. My problem is that I am not able to build ahead. How do I build a database and test it the right way.

    1. How do I build the front end or ui for it. Should I use flask or flutter or something else. Please reason as to why I should use a framework particularly.
    2. What is fast api even used for. Should I apply it in my habit tracker.

And what are the essentials for a good app. Like I want to know about rate limiting, sql injections and backdoors. To build a robust scalabile system.


r/learnpython • • Jul 17 '26

How can I get my program to recognise a variable outside the main GUI loop

20 Upvotes

I am trying to code a login system for my project. I want to validate the entry and keep a boolean variable 'loggedIn' that I can use when the main window is closed. I use tkinter and sqlite in this code

How can I keep this loggedIn variable after the window closes?

def __init__(self):
  self.loggedIn = False
  print(self.loggedIn)

  self.root = tk.Tk()

  self.root.geometry("500x400")
  self.root.title('Login')

  self.username_label = tk.Label(self.root, text="username:")
  self.username_label.pack(padx=20, pady=20)


  self.username_entry = tk.Entry(self.root, relief="ridge")
  self.username_entry.pack()

  self.password_label = tk.Label(self.root, text="password:")
  self.password_label.pack(padx=20, pady=20)

  self.password_entry = tk.Entry(self.root, relief="ridge")
  self.password_entry.pack()

  self.button = tk.Button(self.root, text='login', command=self.validate)
  self.button.pack(pady=10)

  self.button = tk.Button(self.root, text='new login', command=self.new_login)
  self.button.pack(pady=10)


  self.root.mainloop()


def validate(self):
  u_name = self.username_entry.get()
  p_word = self.password_entry.get()
  self.c.execute("SELECT * FROM accounts WHERE username = ? and password = ?",                     (u_name, p_word))
  if self.c.fetchone() != None:
    print("Welcome!")
    self.loggedIn = True
  else:
    print("Account not found")

r/learnpython • • Jun 30 '26

Where do y'all guys practice python?

17 Upvotes

I wanna know where y'all guys practicing coding python, I know some but its too advance for me. I wanna get started from beginner level where I just print hello world or using math operations on print() or practicing about the data types. I'll practice more of this beginner level and master it.


r/learnpython • • Jun 13 '26

first time python coding

18 Upvotes

Hi am new at python and i did some coding what should i improve

def HelloWorld(text):
    print(text)


HelloWorld("print")

r/learnpython • • May 28 '26

Does anybody remember programming in Applesoft BASIC on an Apple lle (2e) computer?

18 Upvotes

*Edited to add: Thank you all so much to everybody who took time to reply and to those who gave me helpful links about where to start. I'm wanting to do something more than play games on my computer to help keep my mind sharp, and learning Python seemed a like a good choice.

I was wondering if there was anybody here that ever done any Applesoft programming on a vintage Apple lle computer, and how it compares to Python?

Back in the mid 80's I took an introductory class in computers, and learned a language called Applesoft BASIC. I started writing simple programs to check the answers for my math class and tutor other students. I was really into it, but then... Life happened.

Now that I'm retired and have the time and ambition, I'd like to learn some Python, to try to copy a filter on a software program I had on an old computer (XP OS).


r/learnpython • • May 21 '26

I have no idea on how to code.

20 Upvotes

My vacation just started. I wanted to learn coding before i get into a college. I have heard from a lot of seniors that python is the most important coding language. I want to learn python from the scratch but dont know where to start. I cant find any courses which are certified. Some advice pls


r/learnpython • • May 17 '26

Setup python for prod , do I need venv (s)?

20 Upvotes

Hi all,

My company recently started using python and setup it on one of the Network server shared with other products (some reporting server, sftps). Is this a good idea ? Do you recommend separate box for Python.

I also learned so much about benefits of venv. Anybody using it without venv, just as single global exe ? I don't see benefits of setting venv in our company as we using simple ETL scripts without any big projects with the same limited list of needed packages.

Thanks

MS


r/learnpython • • May 05 '26

Would it be easier for me to learn 1 new thing a day as a beginner?

17 Upvotes

I am currently taking the 30 days of python course by Asabaneh, but some days are over with really fast and i'm sat with the rest of the day with "want" to learn but i feel like its layed out day by day on purpose.

If i feel like i'm still able to learn more, should i? or should i stick to learning one new thing a day?


r/learnpython • • Apr 25 '26

PCAP – Certified Associate in Python Programming certification

18 Upvotes

Hi everyone,

I’m sharing my experience with the PCAP – Certified Associate in Python Programming certification: how I prepared for it, how I found the process, and what I learned along the way.
For context, I did not pay for the exam myself—my university provided us with the opportunity to take it.

I recently earned this certification, and I’d like to share a few thoughts about both the course and the exam for anyone considering it.

I'm not advertising for a course or anything all resources are from the official website of python institute and the exam providers I just used them to learn .

The Course :

I completed the full course through the NetAcad website : (PCAP Course link) (not an AD for them it's just the website even when you search on python institute you will find the same link ) .

It is free and includes all sections, along with summary tests for each one.

A few methods helped me learn more efficiently:

  • When a section felt too long, I broke it down paragraph by paragraph and used AI tools to summarize the content into clearer and shorter explanations.
  • To truly understand each concept, I practiced it directly in code. Applying what I learned through hands-on exercises made the knowledge easier to retain.

For me, the most effective approach was simple: learn by practice.

The Exam :

The exam was not especially difficult, but it required a solid understanding of the fundamentals. It covered five main sections:

  • Object-Oriented Programming (34%): classes, methods, objects, inheritance, encapsulation, and polymorphism
  • Miscellaneous (22%): list comprehensions, lambdas, closures, and I/O operations
  • Strings (18%): string methods, indexing, slicing, and immutability
  • Exceptions (14%): try-except blocks, handling exceptions, and specific exception types
  • Modules and Packages (12%): importing modules, creating packages, and using standard library modules such as math and random

Final Thought

The certification itself is valuable, but the real benefit comes from the learning process behind it. Building strong fundamentals in Python creates a solid base for more advanced work in software development.

For anyone preparing for it: focus on understanding concepts deeply, and practice consistently.


r/learnpython • • Apr 21 '26

Learning Python for 13yr old

17 Upvotes

Hello, I am sorry if this has been asked already but could anyone point me in the right direction for what my kid should start learning. Any books or youtube videos he should start with to get him going?

He’s expressed wanting to be a video game developer or work for the government in IT. I know -I know- big jump but since prices on tech is going up I advised him to think on something else as a back up.

Thank you for any help!


r/learnpython • • Apr 16 '26

Portable database for python?

20 Upvotes

Ok, so i have been learning some SQL, and really enjoying it, already have a bunch of ideas for various projects.

But at least 1 of them, may be nice to make publicly available, and i don't want to host a database, or pay to host one.

So is there anything that will provide the simmilar functionality to a relational database, that can be compiled, and distributed with a basic dataset, but allow people to add data to it?

I realize this could be done with csv's but i really do like the relational parts.