|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
__________________
*** Experimental Python Markup CGI V2 *** |
|
#3
|
|||
|
|||
|
Yes looked at the site , tried it runs with out any error but can't find the exe file
|
|
#4
|
||||
|
||||
|
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. |
|
#5
|
||||
|
||||
|
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 ![]() |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
||||
|
||||
|
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 ![]() |
|
#8
|
|||
|
|||
|
Hi Grims
It works Thank you so much |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > how 2 py2exe |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|