Join us at IRC!
Become the change you seek in the world. - Gandhi
Friday, May 25, 2012
Navigation
Members Online
Total Online: 36
Web Spiders: 14
Guests Online: 35
Members Online: 1

Registered Members: 70209
Newest Member: KalareShou
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

Python compiling to .exe

ctrl_
Member



Posts: 15
Location:
Joined: 11.02.09
Rank:
Wiseman
Posted on 28-08-09 16:28
Is it possible to compile a program written in Python to a single file? I have tryed pyInstall which I saw some one claimed that was able to do the trick, but sadley it wern't compatible with 2.6.

So basically, I'am wondring if it is possible with any tools available at the time.


Author

RE: Python compiling to .exe

GTADarkDude
Member



Posts: 142
Location: The Netherlands
Joined: 23.02.08
Rank:
God
Posted on 28-08-09 16:34
You mean like py2exe? http://www.py2exe.org/


...

Edited by GTADarkDude on 28-08-09 16:34
- - - -
Author

RE: Python compiling to .exe

ctrl_
Member



Posts: 15
Location:
Joined: 11.02.09
Rank:
Wiseman
Posted on 28-08-09 16:37
For what I know py2exe creates several files and cannot compile it all to a single file.


Author

RE: Python compiling to .exe

DarkPrinceFrost
Member

Posts: 17
Location:
Joined: 10.06.09
Rank:
Monster
Posted on 28-08-09 16:43
What about using a file wrapper to make one file out of several?


-=Frost=-
Author

RE: Python compiling to .exe

ctrl_
Member



Posts: 15
Location:
Joined: 11.02.09
Rank:
Wiseman
Posted on 28-08-09 17:12
Bah I'am a idoit for not reading all the py2exe docs. I found out py2exe was able to do it. It creates one EXE, which *temporarily*
unpacks the components that have be in separate files for Windows to find
them. When you terminate the program, the files are removed.
You will need to edit the setup.py slightly.
from distutils.core import setup
import py2exe, sys, os

sys.argv.append('py2exe')

setup(
options = {'py2exe': {'bundle_files': 1}},
windows = [{'scblockedript': "yourapp.py"}],
zipfile = None,
)

http://stackoverflow.com/questions/112698/py2exe-generate-single-executable-file


Guest
Username

Password

Remember Me


Bookmark This Page
Affiliates
Adverts

 

 

Links
By using, viewing or obtaining any information contained on this site, you agree to the disclaimer.

© HellBound Hackers 2008- 2009. Since 3rd December 2004.