Follow us on Twitter!
Imagination is more valuable than knowledge - Albert Einstein
Monday, April 21, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 29
Guests Online: 28
Members Online: 1

Registered Members: 82851
Newest Member: darthvador
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

Python compiling to .exe


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
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:
Newbie
Posted on 28-08-09 16:34
You mean like py2exe? http://www.py2exe. . .


...

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

RE: Python compiling to .exe


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
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


Member

Your avatar

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


Author

RE: Python compiling to .exe


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
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.
Code
from distutils.core import setup
import py2exe, sys, os

sys.argv.append('py2exe')

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




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