|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
How to convert .py to .exe?
I installed python and py2exe.How can I use py2exe to convert py file to exe file?Thank you.
|
|
#2
|
||||
|
||||
|
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
|
#3
|
|||
|
|||
|
Thanks.A question:What should I put "python setup.py py2exe"?Inside the code?
|
|
#4
|
||||
|
||||
|
No, you run that from the command line.
|
|
#5
|
|||
|
|||
|
run from Python command?
|
|
#6
|
|||
|
|||
|
from the command line you would type:
"python setup.py py2exe" This will launch setup.py, setup.py will tell py2exe which python file you want to convert to an exe |
|
#7
|
|||
|
|||
|
I saved my work at D:\abc1\abc1\, then i tried to type "c:\python23\python.exe d:\abc1\abc1\setup.py py2exe".The program I made run,but in the command-line,there are some lines said:
running py2exe running build running build_scripts error file 'abc.py' does not exist. Also,I couldn't find the .exe file. This is my seutp.py file: # setup.py from distutils.core import setup import py2exe setup(name="abc", scripts=["abc.py"], ) Thanks a lot. |
|
#8
|
||||
|
||||
|
Do you actually have a file called abc.py somewhere or did you just make that up?
|
|
#9
|
|||
|
|||
|
i have the abc.py file which is in the same folder as setup.py.that's why i am confused about it.
Is my command right? |
|
#10
|
||||
|
||||
|
Ok, then do this instead.
1. Go to the dos command prompt. This can be done by going to Start-->Run... and typing "cmd" (or "command" for Windoze 98) and then hitting enter. 2. On the DOS window, type the following: d: cd \abc1\abc1 c:\python23\python.exe setup.py py2exe See if that helps you. |
|
#11
|
|||
|
|||
|
Thank you so much.It looks working.After I run the command you gave me,there are so many lines coming out.it seems to add some news files in my abc\abc folder.Also,a new folder has been created : dist\abc\.some files like python23.dll and abc.exe are there.Does it mean py2exe successfully?
Thanks a lot. |
|
#12
|
||||
|
||||
|
If you didn't see any error messages, then it must have been successful
![]() |
|
#13
|
|||
|
|||
|
Thank you.Wow!This is the first time I did py2exe.What I did before is run the command under C:,not in my program's folder.Now I understand it.
|
|
#14
|
|||
|
|||
|
I also have a question: when I run the program that I made,the DOS windows always comes out.How can I remove it?
|
|
#15
|
||||
|
||||
|
There are two ways that i know of to do this, 1 you could us the -w flag from the command line, something like..
python setup.py py2exe -w 2, give your python program a .pyw extension (abc.py becomes abc.pyw) Mark. |