Still, the only thing I use with any frequency that is an outright replacement for standard library functionality is requests and beautifulsoup. Well, if you don't include ipython, which is an absolute necessity.
Still, the only thing I use with any frequency that is an outright replacement for standard library functionality is requests and beautifulsoup. Well, if you don't include ipython, which is an absolute necessity.
os
sys
logging
os.path
re
subprocess
datetime
json
pickle
itertools
urllib2
signal
traceback
socket
It has a lot to do with my job - devops for remote clients. I can't rely on the ability to use 3rd party python libraries, and my stuff has to work reliably with few problematic corner cases. The standard library fulfills both of those cases pretty well.To refer back to the "old batteries" argument, the included batteries may be the old lead acid type, but they're dependable in a lot of cases where newer lithium ion batteries would rather catch fire.
I just remember that datetime is the package, datetime.datetime is the class, and datetime.datetime.now() is a @classmethod that returns instances of that class. I do kinda wish it was datetime.now() for the constructor instead.
Or do you find Python's argument parsing to be especially notable for some reason?
* sys.argv
* argparse
* optparse
* getopt
There are, of course, additional third party modules (like opster) that also handle arguments.
optparse is deprecated (kept around for obvious backward-compat reasons)
getopt is just a different API for people who feel more comfortable with C's getopt API and don't want to learn something else
argparse is the CLI option parser for the future.
tl;dr: There is one way to parse command line arguments: sys.argv. But there are a few abstractions of doing that available in the stdlib.