This is a tiny tool used to convert a python script(e.g. demo.py -> demo.command) to a executable file(For mac and Linux),so that you are able to use it anywhere.
Tip: Add #!/usr/bin/env python or #!/usr/bin/env python3 in first line of your script to specify interpreter.So you do not need add python version when you use psc.
$ pip3 install python-script-converter
you can also use pip.
You may either download the stable (identical with the latest release on PyPI) or the master branch of python-script-converter. Unzip it, and do
$ [sudo] python3 setup.py install
you can also use python.
Before use it, you should ensure:
- You're using Mac OS or Linux.
Here's' how you use psc
to create a new executable file base on you original script :
$ psc test.py
Or use abspath.
$ psc /Users/zyh/test.py
$ psc test.py 2
or
$ psc /Users/zyh/test.py 2
then,you can get a executable file,its name is the same as your script,but its extension is .command. and what's more,it will not change your original script.