Convert_py2cmd
|
|--convert_py2cmd.sh # source code
|
|--[target file].py # the file you want to convert
|
|--[output cmd file] # the command file you want
This converter is for Python at path /usr/bin/python
Please check your python path by $ which python
:
#Check python path if you are already installed
$ which python
/usr/bin/python
$ git https://github.com/YenYuHsuan/convert_py2cmd.git
$ cd convert_py2cmd
$ chmod +x convert_py2cmd.sh
$ cp [python file path] .
$ ./convert_py2cmd [target file].py [command you named]
try with example test.py:
$ ./convert_py2cmd test.py pytest
--------------------------------------------------------
Transform test.py to linux command 'pytest'!!
targetfile: test.py
outputfile: pytest
dos2unix: converting file /home/***/convert_py2cmd/pytest to Unix format ...
Command 'pytest' created!!
--------------------------------------------------------
$ pytest
This Python file (test.py) is converted to linux command [$ pytest]!!!