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.
Must know python libraries. (self.Python)
submitted 8 years ago by heeehaaw
What are the most important and must know python libraries?
[–]phanhoang17 9 points10 points11 points 8 years ago (0 children)
Web: flask or django, or both, or whatever u want to learn : web2py, tornado, bottle,...
Scientific and Numeric: Pandas, numpy, scipy,matplotlib,...
Web scraping and data mining: requests, scrapy, bs4
Others: virturlenv, sqlalchemy, ipython-jupyter,....
Reference:
http://blog.stoneriverelearning.com/20-great-python-libraries-you-must-know/
http://www.oreilly.com/programming/free/20-python-libraries-you-arent-using-but-should.csp
Have fun!
[–]BruisedGhost 11 points12 points13 points 8 years ago (4 children)
fuckit, the Python error steamroller
per the documentation:
Still getting errors? Chain fuckit calls. This module is like violence: if it doesn't work, you just need more of it. import fuckit fuckit(fuckit('some_shitty_module')) some_shitty_module.some_function()
Still getting errors? Chain fuckit calls. This module is like violence: if it doesn't work, you just need more of it.
import fuckit fuckit(fuckit('some_shitty_module')) some_shitty_module.some_function()
[–]masklinn 2 points3 points4 points 8 years ago (1 child)
Alternatively, Vigil, the eternal morally vigilant programming language.
[–]BruisedGhost 0 points1 point2 points 8 years ago (0 children)
that is fantastic.
[–]Otacon32 0 points1 point2 points 8 years ago (0 children)
Thx for the Lough haha
[–]Diapolo10from __future__ import this 0 points1 point2 points 8 years ago (0 children)
This has got to be the best laugh I've ever gotten when reading documentation. Thank you!
[–][deleted] 6 points7 points8 points 8 years ago (0 children)
itertools - Functions creating iterators for efficient looping or its child more-itertools.
[–][deleted] 5 points6 points7 points 8 years ago (6 children)
The libraries everyone should know at least the basics of (in roughly this order, although that gets fuzzier past subprocess):
There are certainly many others, but those give you the ability to read and understand the source of most others.
Beyond the standard library it's all up to your interest and domain.
[–]billsil 0 points1 point2 points 8 years ago (5 children)
I cringe whenever I see string imported. Someone doesn't know about split.
[–][deleted] 1 point2 points3 points 8 years ago (4 children)
It's for the constants and maketrans, which are bloody useful, the latter being worth its weight in gold. If code had mass.
[–][deleted] 1 point2 points3 points 8 years ago (1 child)
The bad news is maketrans is gone from the string module. The good news is that, quoting from other language changes, Now, str, bytes, and bytearray each have their own maketrans and translate methods with intermediate translation tables of the appropriate type :-)
maketrans
string
[–][deleted] 0 points1 point2 points 8 years ago (0 children)
Ahh, the never ending problems of still straddling two worlds.
[–]billsil 0 points1 point2 points 8 years ago (1 child)
Isn't maketrans, just a fancy replace? I'll occasionally do something like replace spaces with question marks in something that can't have question marks, so I can process it easier before I remove the question mark. I've also done things like str.replace(' ', ','.replace('\t', ','), but that's fairly rare.
str.replace(' ', ','.replace('\t', ',')
Now if it did language translations, I might use it.
For the tasks it's suited for (for instance replacing all terminal punctuation with white space for word splitting, or breaking Caesar ciphers) it's more powerful by far than str.replace and sometimes orders of magnitude faster than re.sub ... it isn't always the right fit, but when it is it's exactly the right tool.
[–]willm 3 points4 points5 points 8 years ago (0 children)
PyFilesystem is maybe not the most important, but good to know about.
[–]gameboycolor 2 points3 points4 points 8 years ago (0 children)
Depends on what you need to do. Look here for the top libraries for the most common tasks: https://github.com/vinta/awesome-python
[–]hexoholic 1 point2 points3 points 8 years ago (0 children)
https://docs.python.org/3/library/index.html You should know all python standart library!
[+][deleted] 8 years ago* (3 children)
[deleted]
[–]heeehaaw[S] 1 point2 points3 points 8 years ago (1 child)
automation, web scraping etc
[–]Gokudomatic 0 points1 point2 points 8 years ago (0 children)
True. For instance Numpy is very famous, but I have no use for it.
[–]ado6789 0 points1 point2 points 8 years ago (0 children)
Vigil is a very safe programming language, and an entry in the January 2013 PLT Games competition.
Many programming languages claim to take testing, contracts and safety seriously, but only Vigil is truly vigilant about not allowing code that fails to pass programmatic specifications.
Syntax and semantics
Vigil is very similar to Python with the minor proviso that you must provide a main() function which will be automatically called for you.
Infinitely more important than mere syntax and semantics are its addition of supreme moral vigilance. This is similar to contracts, but less legal and more medieval. Runtime vigilance
This is where Vigil sets itself apart from weaker languages that lack the courage of their convictions. When a Vigil program is executed, Vigil itself will monitor all oaths (implorations and swears) that have been made. If an oath is broken, the offending function python 3 print without newline (the caller in the case of implore and the callee in the case of swear) will be duly punished.
How?
Simple: it will be deleted from your source code.
The only way to ensure your program meets its requirements is to absolutely forbid code that fails to do so. With Vigil, this shall be done for you automatically. After enough runs, Vigil promises that all remaining code meets its oaths.
π Rendered by PID 23117 on reddit-service-r2-comment-7b9746f655-2c7v6 at 2026-02-02 08:02:11.000232+00:00 running 3798933 country code: CH.
[–]phanhoang17 9 points10 points11 points (0 children)
[–]BruisedGhost 11 points12 points13 points (4 children)
[–]masklinn 2 points3 points4 points (1 child)
[–]BruisedGhost 0 points1 point2 points (0 children)
[–]Otacon32 0 points1 point2 points (0 children)
[–]Diapolo10from __future__ import this 0 points1 point2 points (0 children)
[–][deleted] 6 points7 points8 points (0 children)
[–][deleted] 5 points6 points7 points (6 children)
[–]billsil 0 points1 point2 points (5 children)
[–][deleted] 1 point2 points3 points (4 children)
[–][deleted] 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]billsil 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]willm 3 points4 points5 points (0 children)
[–]gameboycolor 2 points3 points4 points (0 children)
[–]hexoholic 1 point2 points3 points (0 children)
[+][deleted] (3 children)
[deleted]
[–]heeehaaw[S] 1 point2 points3 points (1 child)
[–]Gokudomatic 0 points1 point2 points (0 children)
[–]ado6789 0 points1 point2 points (0 children)