The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Python Programming
|
how 2 py2exe
Discuss how 2 py2exe in the Python Programming forum on Dev Shed. how 2 py2exe Python Programming forum discussing coding techniques, tips and tricks, and Zope related information. Python was designed from the ground up to be a completely object-oriented programming language.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

June 8th, 2004, 03:58 PM
|
|
Contributing User
|
|
Join Date: Apr 2004
Posts: 57
Time spent in forums: 1 h 6 m
Reputation Power: 10
|
|
|
how 2 py2exe
Dear all
can someone show me how to use py2exe for the following code? complicated.
here is the code
Code:
import random
a=int(raw_input("Enter set(s)of random numbers (6 numbers a set): "))
for x in range (0,a):
for i in range(1,7):
print "\n%5d" % (random.randrange(1,50)),
if i%6==0:
print
Thanks
|

June 9th, 2004, 01:12 AM
|
 |
Mini me.
|
|
Join Date: Nov 2003
Location: Cambridge, UK
|
|
|

June 9th, 2004, 05:57 AM
|
|
Contributing User
|
|
Join Date: Apr 2004
Posts: 57
Time spent in forums: 1 h 6 m
Reputation Power: 10
|
|
|
Yes looked at the site , tried it runs with out any error but can't find the exe file
|

June 9th, 2004, 06:03 AM
|
 |
Hello World :)
|
|
Join Date: Mar 2003
Location: Hull, UK
|
|
The quick way to do this is to search your Python installation directory and documents folder.
Its not easy to keep up with py2exe right now since i've used 3 versions over the last few years and in each one the rules have changed  .
There should be an option to tell py2exe where to put the file though - or there was at some point. You should be able to type 'help' after invoking py2exe for a full list of options.
Hope this helps,
Mark.
__________________
programming language development: www.netytan.com – Hula
|

June 9th, 2004, 06:16 AM
|
 |
Mini me.
|
|
Join Date: Nov 2003
Location: Cambridge, UK
|
|
Assuming you are actually running the latest python version and have installed the latest py2exe program...
Make sure the setup script is in the same directory as the script you want to make an executable. It will then make a dist sub-directory when it is run. The executable should be in that sub-directory.
If you are having problems direct the script to a log file and post the log file here.
python win_exe.py > logfile.txt
Send the logfile and we might be able to help 
|

June 9th, 2004, 06:56 AM
|
|
Contributing User
|
|
Join Date: Apr 2004
Posts: 57
Time spent in forums: 1 h 6 m
Reputation Power: 10
|
|
This is what i did
I keep all my .py in a folder under d:\pyth2, running python from c:\python23
This is how i compiled
c:\python23\python.exe d:\pyth2\lot.py
It created a folder called dist and build in d:\pyth2 and copied _sre.pyd,library.zip,python23.dll,w9xpopen.exe
setup.py
Code:
from distutils.core import setup
import py2exe
setup(name="lot",version="1.0",py_modules=["lot"])
Code:
import random
a=int(raw_input("Enter set(s)of random numbers (6 numbers a set): "))
for x in range (0,a):
for i in range(1,7):
print "\n%5d" % (random.randrange(1,50)),
if i%6==0:
print
I don't know if it's right
Thanks
|

June 9th, 2004, 07:37 AM
|
 |
Mini me.
|
|
Join Date: Nov 2003
Location: Cambridge, UK
|
|
This works:
I've modified your setup script in two ways:
1. I've added the py2exe parameter so that you don't have to type it.
2. I changed your setup to be in line with my script and the guidelines on the py2exe Wiki.
Code:
from distutils.core import setup
import sys
sys.argv.append("py2exe")
import py2exe
setup(console = [{"script": "lot.py", }], version = "1.0", py_modules = ["lot"])
Grim 
|

June 9th, 2004, 08:44 AM
|
|
Contributing User
|
|
Join Date: Apr 2004
Posts: 57
Time spent in forums: 1 h 6 m
Reputation Power: 10
|
|
|
Hi Grims
It works Thank you so much
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|