I remember coming reading about a python module/lib that helped make nice command line scripts that takes in options.
My python script (1 file) does many things, and currently I comment out/uncomment the function I want run in my main section.
I was hoping someone knows the lib I'm talking about that would help me organize the various functions and call them when I run the .py script.
there is an optparse module. in newer variants of python, argparse is preferred.
optparse: http://docs.python.org/library/optparse.html
argparse: http://docs.python.org/library/argparse.html
use optparse in <= 2.7, argparse in > 2.7
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With