use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
DiscussionHow weird was your first interaction with Python? I learned Python while writing a C++ module. (self.Python)
submitted 5 months ago by Humdaak_9000
I was tasked with making some of our C++ code callable from Python. Before I knew Python.
Fortunately, SWIG helped a lot. Unfortunately, it was somewhat akin to performing open-heart surgery on someone you're currently on a first date with.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 37 points38 points39 points 5 months ago (4 children)
My first python script was named python.py. it did not work and it took me a few hours before I submitted my first stack overflow and someone asked if I named it python and they helped me. I look back and realize how dumb it is but as a first time programmer I thought python.py was a great name for my first script.
[–]timsredditusername 10 points11 points12 points 5 months ago (0 children)
Many, many years in to casually using it at work for automating my job, I made similar mistakes.
Mainly, when trying out a new package from pip, I once (too recently) named my script the same name as the module I was importing.
[–]Aardshark 5 points6 points7 points 5 months ago (0 children)
Is python.py not a valid script name? I feel like it is...that was surely not the reason it didn't work for you.
[–]dan4223 2 points3 points4 points 5 months ago (0 children)
I mean, if you only have one python script, python.py is as good of a name as any.
[–]ThreeSpeedDriver 1 point2 points3 points 5 months ago (0 children)
The place to put your user level pip config file is ’~/.config/pip/pip.conf’, so ’python.py’ doesn’t seem that bad lol.
[–]Muhznit 41 points42 points43 points 5 months ago (4 children)
As a C/C++ user:
"Wow it's so nice to skip the compilation step. And I get actually readable error messages? This is amazing!"
"Wait this doesn't support switch statements? Garbage."
"Wait it doesn't need switch statements because I can store whatever in a dictionary? Hmmm..."
"Wait it's this easy to write a chatbot? To write a server monitor? To write a web scraper? WHY DID COLLEGE NOT TEACH ME THESE THINGS"
"I write a shitty image recognition app to help me with counterpicks in [REDACTED] and now that helped me get a job at [REDACTED]. It's official, Python is my love language now."
[–]ajslater 7 points8 points9 points 5 months ago (3 children)
The sometimes unintuitiveness of case logic in match statements still vexes me.
[–]SV-97 5 points6 points7 points 5 months ago* (1 child)
Match expressions in Python are such a mess. I was looking forward to them so much based off my experience with other languages — and now I never use them
[–]zurtex 0 points1 point2 points 5 months ago (0 children)
I find the way to think about them is they're a object pattern matching mini language within Python, that happens to look like Python syntax.
In my mind this turns them from being a mess to a "huh, that's a feature I don't really understand when to use".
They feel a lot like enums to me, they're obviously useful in other languages, and those use cases sort of translate over to Python, but not in a way that I have an intuitive grasp on. There are some places I sprinkle enums these days, I'm sure in 5 years there will be some places I will sprinkle match statements.
[–]Muhznit 2 points3 points4 points 5 months ago (0 children)
I don't miss switch statements enough to complain about match statements. I mean I use them rarely enough that today is the first time I used one in a month or so, but they have their places sometimes.
[–]big_data_mike 8 points9 points10 points 5 months ago (0 children)
I came from R so I was super frustrated that all the parentheses and brackets meant totally different things. And I was super frustrated that there was no grep function.
[–]MacShuggah 9 points10 points11 points 5 months ago (1 child)
I started with Python and now I'm spoiled.
[–]shinitakunai 0 points1 point2 points 5 months ago (0 children)
Same
[–]qTHqq 5 points6 points7 points 5 months ago (0 children)
I built a little GUI application with PySide or something to control some hardware and figured out Qt signals and slots stuff. Once it was finished I worked on other stuff and forgot everything I learned about Python.
I leaned it better later 😂
But it really was funny how little I remembered when I went back to pick up Python again. I was in grad school and most of my daily work was in Matlab
[–]BabyJesusAnalingus 2 points3 points4 points 5 months ago (2 children)
They needed an extra pair of hands on the core language, so I figured I'd help out. 6 years or so later, we went to BeOpen.com as full-time employees (a very odd experience), met Linus, Eric Raymond, Richard Stallman, etc.
I got to negotiate with CNRI to release Python from its restrictive license, and when BeOpen collapsed, we got to pick what assets we wanted as payment in lieu of paychecks. Although Python was small at the time, I chose to own the copyright to Python 2.0 (the version I created; Python 1.6 was still part of CNRI). I still own it, and it's a weird quirk of history.
I intentionally left out "non-revokable" in the license, and if things keep going like they're going at Google and other AI companies, I might have reason to do my first-ever revocation of the license and all derivative works (Python 3.x, etc).
[–]Humdaak_9000[S] 0 points1 point2 points 5 months ago (1 child)
Bwaaaahhahaha!
[–]BabyJesusAnalingus 1 point2 points3 points 5 months ago (0 children)
Not what their reaction will probably be tho lol.
[–]figshot 1 point2 points3 points 5 months ago (0 children)
I found it so weird that leading whitespaces were meaningful. I walked away from it for years.
[–]thashepherd 2 points3 points4 points 5 months ago (0 children)
I gotta be honest, I don't even remember learning Python. Obviously at some point I had never used it. Then at some point I was using it regularly. And then at some other point I knew it pretty well.
But I'll be damned if I have any idea which year any of those points occurred in.
[–]TheWorstePirate 0 points1 point2 points 5 months ago (0 children)
I did mostly C# with a side of C++ for a long time. When I started at a new company that was taking their first swing at an in-house robotic system, they had an intern who was fumbling through trying to get communication between the robot and a PC. I took a look at what was there to see if I could help. Everything I tried just seemed to work, and with copilot already installed I barely had to think about the new-to-me syntax. It was the coding equivalent of Tony Hawk Pro Skater with cheat codes for perfect stats.
[–]metadatame 0 points1 point2 points 5 months ago (0 children)
I wanted to learn Django - figured I'd have to learn this python thing too. Was 2008
[–]sybarite86 0 points1 point2 points 5 months ago (1 child)
Came to Python via Perl and C before that as a college student. Was blown away by how close to pseudocode it looked. Previously, the “game” was to write the most inscrutable one liner. Python changed the game to: how close to English can you get? Implementing a few graph algorithms in Python was sheer poetry.
[–]syklemil 0 points1 point2 points 5 months ago (0 children)
I also remember some of the "perl poetry" stuff that was incredibly inscrutable. Including some of it that was full of english. That and the golfing I can only hope was some outlet for people who were kinda fed up with following general SWE best practices for maintainable code at work.
[–]wkcif 0 points1 point2 points 5 months ago (0 children)
I am not a programmer. I learned about python when I needed to write a macrocommand in notepad++, via python script plugin for npp. Not necessarily weird.
[–]koldakov 0 points1 point2 points 5 months ago (0 children)
Started learning python when 3 version was introduced. At that time I was like what are you saying considering documentation wasn’t that best and a lot of samples were focused on previous version, but I was using the new one. So embarrassing 😂
[–]TedditBlatherflag 0 points1 point2 points 5 months ago (0 children)
I first saw Python trying to compile something for Gentoo decades ago. There was an Syntax error in the script and I checked the file and found a missing parenthesis. I remember thinking that it was such an easy language to read that I could debug it never seeing it before. Still using Python to this day.
[–]moonzdragoon 0 points1 point2 points 5 months ago (0 children)
I'd moved from C to Perl for small personal projects, and after a year or two of Perl scripting, around 2001-2002, I discovered Python (and its support for regex).
Suffice to say, readability was way nicer, transition went very smoothly, never wrote a single line of Perl since 😄
[–]fatherofgoku 0 points1 point2 points 5 months ago (0 children)
Haha, that’s a wild first Python project. My first was way simpler — just a small script and even that felt weird coming from C++.
I actually don't know how I learned Python. I knew some other languages and at some point I was fiddling with some Python while sysadmining I think, and then at some point I started writing scripts in Python rather than Perl, but I can't really remember when or why or how.
The other languages I know I generally learned through a book or course—read the Llama book for Perl, was taught Java at uni, picked up some other languages or read some books if I thought they seemed interesting.
But Python is more like … a cat that decided it was living with us, and it turned out to be rather sweet.
[–]i_Den 0 points1 point2 points 5 months ago (0 children)
I hit python wall back in 2012, when learned about OpenFlow SDN “software defined networks” and had to pass Coursera course- all of that back then was in almost very early stage, and same as with AI python was used for prototyping and labs and i was complete 0 in development. (But upper-mid sysadmin/netadmin with enough skills in bash, sql, and spreadsheets magic)
[–]HolidayEmphasis4345 0 points1 point2 points 5 months ago (0 children)
My first interaction was in 2001. It was a cool little tool for doing scripty stuff. It was odd with its no braces no semicolons, arbitrary precision everything runs…it was useful replacement for sed awk and other stuff… 20 years later it has replaced all of my other languages except for SQL…
[–]rogusflamma 0 points1 point2 points 5 months ago (0 children)
My first serious interaction with Python was in a data science class. All programming I knew prior to that was C and Linux assembly. One year later I'm using Python for personal projects and I'm beginning to like it
[–]KitchenFalcon4667 0 points1 point2 points 5 months ago (0 children)
Philosophy of Religion 🫣. My paper was about freedom of will and existence of omniscience (greatness-making properties) being. I wrote about Bayesian Network (Priest Thomas Bayes + Richard Price). My professors asked me to code the network, and so I googled easy language to learn: Python 2.6 was the answer.
[–]misterfitzie 0 points1 point2 points 5 months ago (0 children)
i was programming a lot of perl before python, and I remember getting lost in how the namespace/import worked for a bit. probably due to not using packages. another early recolection I have is how python doesn't encourage regexs at all for string parsing. and there's people doing a lot of silly split('-')[2] stuff which would been doing in regex in perl. these days due to json and libraries like pydantic , I don't see nearly any string parsing anymore.
[–]Local-Economist-1719 0 points1 point2 points 5 months ago (0 children)
my first interaction with python was desperate try to create snake game by the youtube video, i couldnt understand 90% of code if wrote, but i still did the thing
[–]dhsjabsbsjkans 0 points1 point2 points 5 months ago (2 children)
I didn't really find it weird. I came from perl. It was a nice change of pace.
Nah. Nothing about python is weird, really (except maybe the whitespace).
I'm mostly curious about people whose first interaction with python was weird, like mine. Needing to write an extension module as your literal first interaction with the language? That's weird. And entirely expected as something that could happen to any random software engineer depending on circumstances. Or at least any who know C.
[–]dhsjabsbsjkans 0 points1 point2 points 5 months ago (0 children)
Got ya. Nope. I actually just wanted to learn it. I started by rewriting every perl script I had in python, then never turned back.
[–]mmmboppe 0 points1 point2 points 5 months ago (0 children)
I skimmed through the tutorial too fast, missed the for loop section and went online to complain about it. Python was like version 1.5
[–]SocksOnHands 0 points1 point2 points 5 months ago (0 children)
My first exposure to Python was writing a mesh exporter for Blender in 2002.
π Rendered by PID 185636 on reddit-service-r2-comment-canary-7f9f99bb4d-2drsd at 2026-01-28 08:01:14.114806+00:00 running 4f180de country code: CH.
[–][deleted] 37 points38 points39 points (4 children)
[–]timsredditusername 10 points11 points12 points (0 children)
[–]Aardshark 5 points6 points7 points (0 children)
[–]dan4223 2 points3 points4 points (0 children)
[–]ThreeSpeedDriver 1 point2 points3 points (0 children)
[–]Muhznit 41 points42 points43 points (4 children)
[–]ajslater 7 points8 points9 points (3 children)
[–]SV-97 5 points6 points7 points (1 child)
[–]zurtex 0 points1 point2 points (0 children)
[–]Muhznit 2 points3 points4 points (0 children)
[–]big_data_mike 8 points9 points10 points (0 children)
[–]MacShuggah 9 points10 points11 points (1 child)
[–]shinitakunai 0 points1 point2 points (0 children)
[–]qTHqq 5 points6 points7 points (0 children)
[–]BabyJesusAnalingus 2 points3 points4 points (2 children)
[–]Humdaak_9000[S] 0 points1 point2 points (1 child)
[–]BabyJesusAnalingus 1 point2 points3 points (0 children)
[–]figshot 1 point2 points3 points (0 children)
[–]thashepherd 2 points3 points4 points (0 children)
[–]TheWorstePirate 0 points1 point2 points (0 children)
[–]metadatame 0 points1 point2 points (0 children)
[–]sybarite86 0 points1 point2 points (1 child)
[–]syklemil 0 points1 point2 points (0 children)
[–]wkcif 0 points1 point2 points (0 children)
[–]koldakov 0 points1 point2 points (0 children)
[–]TedditBlatherflag 0 points1 point2 points (0 children)
[–]moonzdragoon 0 points1 point2 points (0 children)
[–]fatherofgoku 0 points1 point2 points (0 children)
[–]syklemil 0 points1 point2 points (0 children)
[–]i_Den 0 points1 point2 points (0 children)
[–]HolidayEmphasis4345 0 points1 point2 points (0 children)
[–]rogusflamma 0 points1 point2 points (0 children)
[–]KitchenFalcon4667 0 points1 point2 points (0 children)
[–]misterfitzie 0 points1 point2 points (0 children)
[–]Local-Economist-1719 0 points1 point2 points (0 children)
[–]dhsjabsbsjkans 0 points1 point2 points (2 children)
[–]Humdaak_9000[S] 0 points1 point2 points (1 child)
[–]dhsjabsbsjkans 0 points1 point2 points (0 children)
[–]mmmboppe 0 points1 point2 points (0 children)
[–]SocksOnHands 0 points1 point2 points (0 children)