stormalf / pytoc

pytoc a python to exe fake compiler using cython and gcc to create an exe for linux-OS like

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pytoc

pytoc a python to exe fake compiler using cython and gcc to create an exe for linux-OS like

pytoc usage

print("PyToC is a python3 compiler for code written in the python language.")
print("PyToC uses Python3, Cython3 and gcc.")
print("For linux and linux-like OS that have the pre-requisites")
print("Usage: pytoc [options] filename")
print("filename is the basename without extension, the filename.py should exist in the current directory")
print("Options:")
print("-V, --version        Display version number of PyToC compiler")
print("-H, --help           Display this help")
print("-K, --keep           keeps all intermediate files generated by the compiler")
print("-L, --library        Generate filename.so shared library instead of an exe")
print("__________________________________________")
print("Enjoy!")

To convert pytoc.py to an exe pytoc

to create the pytoc as an exe you can use : python3 pytoc.py pytoc

it will create ./pytoc after that you can create other exe from python files or convert them to shared library .so

EXAMPLES

display the help

pytoc --hElp pytoc -H

will display PyToC is a python3 compiler for code written in the python language. PyToC uses Python3, Cython3 and gcc. For linux and linux-like OS that have the pre-requisites Usage: pytoc [options] filename filename is the basename without extension, the filename.py should exist in the current directory Options: -V, --version Display version number of PyToC compiler -H, --help Display this help -K, --keep keeps all intermediate files generated by the compiler -L, --library Generate filename.so shared library instead of an exe

display the version

pytoc -V pytoc --version

will display: PyToC version 1.0.0

generate an exe

you should be in the directory when you'll find the python file. Example we have a test.py

pytoc test

will create a test exe from the test.py and removes the intermediate files by default before in the directory : test.py after pytoc test : test test.py

with pytoc test --keep or pytoc test -K setup.py test test.c test.o test.py test.pyx

generate a shared library .so

you should be in the directory when you'll find the python file to convert to a shared library pytoc test -L

will create the shared library : test.cpython-38-x86_64-linux-gnu.so

with pytoc test -L -K will keep the dir and temp files : build setup.py test.c test.cpython-38-x86_64-linux-gnu.so test.py test.pyx

About

pytoc a python to exe fake compiler using cython and gcc to create an exe for linux-OS like

License:MIT License


Languages

Language:Python 100.0%