Search
Latest topics
Who is online?
In total there are 7 users online :: 0 Registered, 0 Hidden and 7 Guests None
Most users ever online was 38 on Sun Mar 19, 2023 10:07 pm
Most Viewed Topics
Python to exe
Page 1 of 1
Python to exe
After recently searching for awhile for a decent HOWTO on making an exe from python I have decide to create one for future learners. This will show you the necessary steps (and commands) to take your python script and transform it into an executable file.
Step One: Files required
This tutorial makes use of py2exe, a free module that is one of the simplest ways to convert our python script. Py2exe can be downloaded at [You must be registered and logged in to see this link.] Depending on the python version you are using (2.7/2.6/2.5/etc) you want to download that version of py2exe. There are also 64bit options available. Please note that you will need to use the necessary 32/64bit option to install py2exe.
Py2exe is a very quick install and will probably fill you with nostalgia with it's partially obnoxious full screen installer.
Step Two: Converter Script
Once you've installed py2exe now you need to create the converter script. This is a fairly simple process and the only thing you need to change is the filename in the code below:
Code:
from distutils.core import setup
import py2exe
setup(console=["CHANGEME.py"])
Again, you only need to change the "CHANGEME" section of the code with your appropriate script's name. Please view the spoiler below for visual aid.
Step Three: Converting your Script
In order to actually convert your script now you need to open up the Windows Command Line (CMD) and navigate to where your setup script and python script are located. Once you navigate to the directory your script is in run the command:
Code:
setup.py py2exe
[You must be registered and logged in to see this image.]" />
[You must be registered and logged in to see this image.]" />
This will run the setup script and convert your py. to .exe.
For those unfamiliar with CMD there are visual aids and a more in-depth instruction on the exact commands necessary below.
You should end up with a new directory in the folder that your script was in labeled: Dist(distribution). This is the folder that py2exe outputs to.
Thank you for reading the tutorial and good luck fellow coders
Step One: Files required
This tutorial makes use of py2exe, a free module that is one of the simplest ways to convert our python script. Py2exe can be downloaded at [You must be registered and logged in to see this link.] Depending on the python version you are using (2.7/2.6/2.5/etc) you want to download that version of py2exe. There are also 64bit options available. Please note that you will need to use the necessary 32/64bit option to install py2exe.
Py2exe is a very quick install and will probably fill you with nostalgia with it's partially obnoxious full screen installer.
Step Two: Converter Script
Once you've installed py2exe now you need to create the converter script. This is a fairly simple process and the only thing you need to change is the filename in the code below:
Code:
from distutils.core import setup
import py2exe
setup(console=["CHANGEME.py"])
Again, you only need to change the "CHANGEME" section of the code with your appropriate script's name. Please view the spoiler below for visual aid.
Step Three: Converting your Script
In order to actually convert your script now you need to open up the Windows Command Line (CMD) and navigate to where your setup script and python script are located. Once you navigate to the directory your script is in run the command:
Code:
setup.py py2exe
[You must be registered and logged in to see this image.]" />
[You must be registered and logged in to see this image.]" />
This will run the setup script and convert your py. to .exe.
For those unfamiliar with CMD there are visual aids and a more in-depth instruction on the exact commands necessary below.
You should end up with a new directory in the folder that your script was in labeled: Dist(distribution). This is the folder that py2exe outputs to.
Thank you for reading the tutorial and good luck fellow coders
Similar topics
» Multiencoder (Python)
» Battle ship in python
» how to create a grid in python??? help!
» Creating a new Python script
» Executing and debugging Python
» Battle ship in python
» how to create a grid in python??? help!
» Creating a new Python script
» Executing and debugging Python
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Tue Feb 02, 2021 7:12 am by manas41
» SQL injection and Quote escaping
Sun Jun 28, 2015 11:42 am by ADS1
» [TUT] Chmod: Files & Permissions [TUT]
Thu Jun 04, 2015 12:45 pm by Guest
» Reaver pixiewps
Thu Jun 04, 2015 12:23 pm by voidfletcher
» How To Crash Someone's Skype in 10 SECONDS
Thu Jun 04, 2015 12:20 pm by voidfletcher
» Internet Security & IP Security (IPSec)
Mon May 18, 2015 9:00 pm by voidfletcher
» [Python] Infinite / Definite File Generator
Mon May 18, 2015 8:58 pm by ADS1
» [C#] String Case-Inversion
Mon May 18, 2015 8:57 pm by ADS1
» Rekall Memory Forensic Framework
Sat May 16, 2015 8:55 pm by ADS1