So I created a couple of modules: module1.py and module2.py and they're both working fine.
But now I would like to call them from the command line using a script by specifying a corresponding option. For example:
python launchscript.py -l somefile.txt
Or
python launchscript.py -x
First option should sent the parameter and execute main() from module1.py and second option should execute main() from module2.py
This launch script should be extensible as I add more internal modules and it should offer built-in command line help.
I'm a python beginner, any help would be appreciated
argparse
- have you tried actually using that library? What exactly is your question? – jonrsharpe Nov 20 '14 at 11:27