4 Replies - 3238 Views - Last Post: 19 October 2008 - 12:17 PM Rate Topic: -----

#1 -Fabez-  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 46
  • Joined: 19-October 08

Create Singe .Exe From Python Script

Posted 19 October 2008 - 06:54 AM

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-

Is This A Good Question/Topic? 0
  • +

Replies To: Create Singe .Exe From Python Script

#2 Stutzbach  Icon User is offline

  • New D.I.C Head

Reputation: 6
  • View blog
  • Posts: 29
  • Joined: 06-July 08

Re: Create Singe .Exe From Python Script

Posted 19 October 2008 - 08:15 AM

View Post-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!
Was This Post Helpful? 1
  • +
  • -

#3 -Fabez-  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 46
  • Joined: 19-October 08

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 :D
Was This Post Helpful? 0
  • +
  • -

#4 -Fabez-  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 46
  • Joined: 19-October 08

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 :D
Was This Post Helpful? 1
  • +
  • -

#5 Stutzbach  Icon User is offline

  • New D.I.C Head

Reputation: 6
  • View blog
  • Posts: 29
  • Joined: 06-July 08

Re: Create Singe .Exe From Python Script

Posted 19 October 2008 - 12:17 PM

View Post-Fabez-, on 19 Oct, 2008 - 12:34 PM, said:

I had to change windows to console, but other than that it worked perfect, thanks :D


Glad I could help. :D
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1