Compile python executable only for package deployment on Linux

King animator333 at gmail.com
Tue Jul 20 12:45:25 EDT 2010


Hi,

I have created a simple tool(python script) that creates a self
sufficient package ready for deployment. Current implementation is
based on shell scripting to set environment for the app and finally
execute "python main.py".

I am planning to convert "main.py" into an executable. The plan is to
rip the unnecessary code from source code that produce python
executable such as command line arguments etc, use "main.py" as python
string (hardcoded inside executable source) and execute it using
"exec" or similar methods and finally creates executable.

Am I right here? Is this is the correct approach?

For example a simple script:

import os
import math
print math.sin(23.0)
print os.getenv("PATH")

Once I'll convert above script as i have mentioned above in an
executable say: "myapp", executing "myapp" will print messages on
console.

Cheers

Prashant



More information about the Python-list mailing list