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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -