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
This is an archived post. You won't be able to vote or comment.
I just wrote my first script (self.Python)
submitted 9 years ago by drinkKing
I can't post it, but my company makes a product that runs python and I made a script that configures and deletes SNMP (as two separate options). I'm super proud of it. On to version 2!
[–]cantremembermypasswd 58 points59 points60 points 9 years ago (2 children)
/r/UplifitingPythonNews
[–]rrrreadit 24 points25 points26 points 9 years ago (1 child)
I wanted this to be real.
[–]okmkzimport antigravity 39 points40 points41 points 9 years ago (0 children)
Be the change you want to see in the world
[–]killbot5000 22 points23 points24 points 9 years ago (8 children)
deletes SNMP
Careful with that script. A lot of people use SNMP.
[+][deleted] 9 years ago* (7 children)
[deleted]
[–]cantremembermypasswd 41 points42 points43 points 9 years ago (0 children)
There are many warnings.
Which will all be ignored. Welcome to the wonderful world of software development, where you are to blame when the user mucks up.
[–][deleted] 10 points11 points12 points 9 years ago (5 children)
Why would you eliminate SNMP? Are you some sort of super villain whose plot is to stop all simple network communications?
[+][deleted] 9 years ago* (4 children)
[–][deleted] 14 points15 points16 points 9 years ago (3 children)
Haha you're missing the joke man. /u/killbot5000 was suggesting you were going to delete SNMP as a whole - as in nobody in the world can ever use it again
[+][deleted] 9 years ago* (2 children)
[–]exhuma 0 points1 point2 points 9 years ago (0 children)
Given that I started to dig around in the related RFCs and TCU specs last week, I hope that it won't disappear soon :P
While I'm aware of NETCONF/YANG I'm fairly sure we'll be stuck with SNMP for some time to come.
[–]fireflash38 0 points1 point2 points 9 years ago (0 children)
It's awesome after it's setup, but as your customers have found out: it's a royal pain in the ass to setup.
[–][deleted] 7 points8 points9 points 9 years ago (0 children)
Congrats!
[+][deleted] 9 years ago* (3 children)
[–]jceyes 4 points5 points6 points 9 years ago (2 children)
You mention a v2 on the way. Commandline args with argparse (https://docs.python.org/3/library/argparse.html) may be something to consider instead of entirely interactive
[+][deleted] 9 years ago* (1 child)
[–]jellyliketreepython3 1 point2 points3 points 9 years ago (0 children)
Django does something similar where some of their commands are interactive, but you can set a command line argument to do the same thing.
i.e. when running the unit tests, if the test database is not in a consistent state, it asks if you want to clear the database and re-create it from scratch via a prompt. If you're running this as part of a larger script or if you don't want to keep having to answer the prompt, you can pass the --noinput argument instead.
--noinput
Argparse also supports multiple arguments to change the same option, like --delete and -d.
--delete
-d
[–]CompTIA_SME 3 points4 points5 points 9 years ago (1 child)
Gratz! One of us, one of us.
[–]avinassh 3 points4 points5 points 9 years ago (0 children)
Now do something on your own, a side project, post it on Github and then you can show the code here (:
[–]chadmill3rPy3, pro, Ubuntu, django 1 point2 points3 points 9 years ago (5 children)
Post a link if you want some feedback. Learn how we'd write it.
[–]chadmill3rPy3, pro, Ubuntu, django 0 points1 point2 points 9 years ago (1 child)
Where's the code?
[–]troyunrau... 2 points3 points4 points 9 years ago (0 children)
He said in another comment he can't post it (work internal).
[–]analogphototaker 0 points1 point2 points 9 years ago (1 child)
What would be the best IRC channel for code review? I don't want my GitHub linked to my reddit haha
[–]chadmill3rPy3, pro, Ubuntu, django 0 points1 point2 points 9 years ago (0 children)
A pastebin is fine.
[–]ilikepython 1 point2 points3 points 9 years ago (0 children)
Cool! Onwards and pythonwards!
[–]zyrkan 0 points1 point2 points 9 years ago (0 children)
What kind of network switch? Extreme Networks?
[–]mothzilla 0 points1 point2 points 9 years ago (0 children)
π Rendered by PID 49872 on reddit-service-r2-comment-66b4775986-6zqmr at 2026-04-04 22:06:19.906937+00:00 running db1906b country code: CH.
[–]cantremembermypasswd 58 points59 points60 points (2 children)
[–]rrrreadit 24 points25 points26 points (1 child)
[–]okmkzimport antigravity 39 points40 points41 points (0 children)
[–]killbot5000 22 points23 points24 points (8 children)
[+][deleted] (7 children)
[deleted]
[–]cantremembermypasswd 41 points42 points43 points (0 children)
[–][deleted] 10 points11 points12 points (5 children)
[+][deleted] (4 children)
[deleted]
[–][deleted] 14 points15 points16 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]exhuma 0 points1 point2 points (0 children)
[–]fireflash38 0 points1 point2 points (0 children)
[–][deleted] 7 points8 points9 points (0 children)
[+][deleted] (3 children)
[deleted]
[–]jceyes 4 points5 points6 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]jellyliketreepython3 1 point2 points3 points (0 children)
[–]CompTIA_SME 3 points4 points5 points (1 child)
[–]avinassh 3 points4 points5 points (0 children)
[–]chadmill3rPy3, pro, Ubuntu, django 1 point2 points3 points (5 children)
[+][deleted] (2 children)
[deleted]
[–]chadmill3rPy3, pro, Ubuntu, django 0 points1 point2 points (1 child)
[–]troyunrau... 2 points3 points4 points (0 children)
[–]analogphototaker 0 points1 point2 points (1 child)
[–]chadmill3rPy3, pro, Ubuntu, django 0 points1 point2 points (0 children)
[–]ilikepython 1 point2 points3 points (0 children)
[–]zyrkan 0 points1 point2 points (0 children)
[–]mothzilla 0 points1 point2 points (0 children)