#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2005
    Posts
    133
    Rep Power
    11

    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.

    Any help?
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    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.

    Take care,

    Mark.
    programming language development: www.netytan.com Hula

  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2005
    Posts
    133
    Rep Power
    11
    Python 2.4.1
    MS Windows XP pro

    Hello.py
    Code:
    #Start here
    print "Hello py2exe"
    raw_input("Press any key to finish")
    #End here

    Setup.py
    Code:
    #Start here
    from distutils.core import setup
    import py2exe
    
    setup(console = ["hello.py"])
    #End here
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Posts
    73
    Rep Power
    10
    Originally Posted by CrAzY_J
    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.

    Any help?
    why using start, this will execute setup.py in a new window, and closes immediatly, you won't see what happened

    just use ( setup.py py2exe ) or ( python setup.exe py2exe )
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2005
    Posts
    133
    Rep Power
    11
    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?
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Posts
    73
    Rep Power
    10
    Originally Posted by CrAzY_J
    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?
    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
    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

    • CyBerHigh agrees
    • netytan agrees : A nice explanation.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2005
    Posts
    133
    Rep Power
    11
    thanks for the explanation

    so if im going to program for MS windows only, i dont need py2exe?
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    461
    Rep Power
    25
    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.
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2005
    Posts
    133
    Rep Power
    11
    okat thanks ^_^

IMN logo majestic logo threadwatch logo seochat tools logo