April 29th, 2005, 01:17 PM
P2Yexe guide problemo
Ive follow everything correctly but when i run:
start setup.py py2exe
nothing really happens, i see a prompt for a second and no extra directory has been created.
April 29th, 2005, 03:06 PM
You need to give us more information that that i.e. what version of Python and Py2exe are you using. Also, what version of Windows. It would also be helpful if you posted your program and setup.py file.
April 29th, 2005, 03:18 PM
MS Windows XP pro
print "Hello py2exe"
raw_input("Press any key to finish")
from distutils.core import setup
setup(console = ["hello.py"])
April 29th, 2005, 06:59 PM
why using start, this will execute setup.py in a new window, and closes immediatly, you won't see what happened
Originally Posted by CrAzY_J
just use ( setup.py py2exe ) or ( python setup.exe py2exe )
April 29th, 2005, 07:57 PM
i fixed it now, thanks for the help .
one very stupid question though: what's py2exe actually for?
cant you just compile with Python 2.4?
April 29th, 2005, 09:23 PM
When you compile a program to a .exe, it's compiled for a specific platform(specific machine and operating system), thus the compiled byte-code is translated after compiling for such instructions of certain platforms
Originally Posted by CrAzY_J
however, this makes the development process harder, because you must compile each program you make for each platform you're going to distribute your application to.
so, the solution was creating a programming language and an interpreter, which acts as a virtual machine, this application may have different versions for different platforms while you only compile your code once, making your code dependent on such Virtual machines examples are Python, Java, Perl
in python when you compile your application, you compile to a byte-code readable by the Python Virtual Machine(.pyc), and not a direct executable by windows e.g a .exe
anyway, some people might not have python, so here comes py2exe, it takes your module, and all other neccessary modules along with python virtual machine and creates a .exe (for Windows)
A Final word, it seems not logical to create a .exe (which contains the python virtual machine, standard modules used, your application) for each program you create for your own, example a CGI for your server, a logging system, scripts which is going to be used on your computer, Consider only when you distribute your application to users who don't have python, use py2exe
anyway, another solution is to force your users to install python, this way you don't have to deal with py2exe anymore
Comments on this post
April 29th, 2005, 10:01 PM
thanks for the explanation
so if im going to program for MS windows only, i dont need py2exe?
April 29th, 2005, 10:54 PM
Not nessesarly. IT depends on what your coding for. If your code is being distrubited to users that may nto have python installed on there computer, then you may decide it is worth doing the extra work to let them use your app.
if you are developing only for yourself or for small apps on your computer and you have python installed, then it is pretty pointless to make an exe out of your app.
For some of my apps i will include a setup.py file, for py2exe, as a contrib. That way if a user would like to make it exe than they can.
April 30th, 2005, 09:01 AM