Python package callable from the shell? -


i have tool written in python turn python package, make easier install dependencies , distribute it.

there 2 usages:

  1. you import module mytool.py, call wrapper function on it, summary of measurements printed on screen , obtain dictionary full results. import mytool; results = mytool.mytool(param1=1, param2=2)
  2. you call mytool.py shell, same parameters above , summary of measurements printed on screen. $ python mytool.py --param1 1 --param2 2

would correct? understand when install package pypi, main usage 1 in point 1. once installed, cumbersome go find exact path mytool.py, , call shell. there alternative?

i think fine, make sure in setup.py specify nice path store script playing bit disutils lib

from distutils import setup setup(     ...,     scripts=['path/to/your/script',],     ... ) 

some nice info can found here https://docs.python.org/2/distutils/index.html#distutils-index

https://docs.python.org/2/distutils/packageindex.html


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -