Executable scripts must have this structure at a minimum:
#!/usr/bin/env python def main(): # do stuff with sys.argv, etc. if __name__ == '__main__': main() # this should be the only statement in this block
The filename should follow the rules for Python module names, e.g. such that for a script called mtpy/utils/my_script.py you can do
mtpy/utils/my_script.py
>>> import mtpy.utils.my_script
This rules out dashes in filenames.
Then you must add a new entry to this part of setup.py:
setup_kwargs['entry_points'] = {'console_scripts': [ # ... 'my_script = mtpy.utils.my_script:main', # << Add your new script # ...]}
and that's it.
There was an error while loading. Please reload this page.