call python module functions from command line -
call python module functions from command line -
i know if there way phone call module functions command line. problem have file bundle called find_mutations. requires input files sorted in specific way, made function so. user able have alternative run code normally:
$ python -m find_mutations -h or run specific sort_files function:
$ python -m find_mutations.sort_files -h is possible? if so, sort_files function need in own strip? need add together __init__.py script? bundle install , runs fine, add together this.
you add together flags run function. next illustration not way work command arguments, demonstrates idea.
import sys if __name__ == "__main__": if '-s' in sys.argv: sort_files() add flag run specific function, in case -s sort files.
python function module distutils setup.py
Comments
Post a Comment