Recently I have created a utility using Python. It works perfectly well on my computer as I have Python installed, however it will not work on other computers as they do not have Python installed. I thought about using Portable Python, but decided against it as I want to keep my utility small. I used Py2Exe , but that generates more than one file and I need a single .Exe file. Next I looked at PyInstaller, but found the documentation confusing. Any help, advice or pointers would be much appreciated. Thanks -Fabez-
Create Singe .Exe From Python Script
Page 1 of 14 Replies - 2828 Views - Last Post: 19 October 2008 - 12:17 PM
Replies To: Create Singe .Exe From Python Script
#2
Re: Create Singe .Exe From Python Script
Posted 19 October 2008 - 08:15 AM
-Fabez-, on 19 Oct, 2008 - 07:54 AM, said:
Recently I have created a utility using Python. It works perfectly well on my computer as I have Python installed, however it will not work on other computers as they do not have Python installed. I thought about using Portable Python, but decided against it as I want to keep my utility small. I used Py2Exe , but that generates more than one file and I need a single .Exe file. Next I looked at PyInstaller, but found the documentation confusing. Any help, advice or pointers would be much appreciated. Thanks -Fabez-
You can do this with Py2Exe, but it requires a few extra options:
target = {
'script': 'your_script_name.py',
}
setup(windows=[target],
name="exe_name",
options = {'py2exe': {"bundle_files": 1, }},
zipfile=None
)
The bundle_files option tells py2exe it to bundle everything including the python interpreter, and the zipfile=None tells it to put the bundle into the executable instead of in library.zip.
Hope that helps!
#3
Re: Create Singe .Exe From Python Script
Posted 19 October 2008 - 09:00 AM
Thanks for that, I will give it a try and post how it goes
#4
Re: Create Singe .Exe From Python Script
Posted 19 October 2008 - 11:34 AM
I had to change windows to console, but other than that it worked perfect, thanks
#5
Re: Create Singe .Exe From Python Script
Posted 19 October 2008 - 12:17 PM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|