Sign in to follow this  
boolean010

How to turn python script into executable

Recommended Posts

I downloaded and installed py2exe-0.6.8.win32-py2.5 How am I suppose to create an executable, is it on the command line or in IDLE test.py -------------------------------- print "Hello, World" ---------------------------------------- I tried python -O test.py, but it doesnt create an executable.

Share this post


Link to post
Share on other sites
Python is bytecode interpreted. What this means is that the Python interpreter compiles your Python source code into a bytecode format, then executes that. (Look around your system for files with the extension .pyc). To run a Python program without shell association:
C:\> python test1.py

With shell association, which causes all .py files to be executed by python.exe:
C:\> test1.py

If you don't want the console window that pops up (say, once you start making purely graphical Python programs), rename your scripts to have a .pyw extension, or"
C:\> pythonw test1.py


Now, if you actually want to create an executable for purposes of packaging and distribution, such that your end users don't need to install Python, look into py2exe.

Share this post


Link to post
Share on other sites
I'm not sure if you edited your post or if the other posters missed the bit in your original post that said you downloaded py2exe. Either way, everything you need to know is on the py2exe site, where you probably downloaded the program from. Follow the Tutorial link, and read everything there.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this