- Compiling Python.
There are some tools like py2exe and py2app, but I recommend cxfreeze since it works with Linux.
Download it: http://prdownloads.sourceforge.net/cx-f ... z?download
Unpack it and install it with:
- Code: Select all
python setup.py build
python setup.py install
Compile your code with:
- Code: Select all
cxfreeze name_of_script.py
It should create a folder name build, inside is your compiled script.
- Interpreting C.
You need to install tcc:
- Code: Select all
sudo apt-get install tcc
Just add this line at the beginning of your .c file:
- Code: Select all
#! /usr/bin/tcc -run
You can also run code directly from the command line:
- Code: Select all
echo 'main(){puts("hello world");}' | tcc -run -
Notes:
What the C interpreter actually does is compile the code into memory and run it, which is basically what interpreters do.
Cxfreeze on the other hand runs the code in the python interpreter and freezes the output to a binary file.


