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

    Join Date
    Nov 2004
    Posts
    40
    Rep Power
    10

    .exe cant run in non-python machine


    hi!

    i was convert a .py file to .exe by using py2exe..
    the .exe can run well in my computer, but it can tbe open when i try to run it (.exe) in another computer which is not python installed..
    can any one give me some tips..
    Code:
    import time
    
    def test():
        print "1"
        time.sleep(1)
        print "2"
        time.sleep(1)
        print "3"
        time.sleep(1)
        print "4"
        time.sleep(1)
        print "5"
        time.sleep(1)
        print "END"
    
    
    if __name__ == '__main__':
        test()
    Code:
    # setupTest.py
    from distutils.core import setup
    import py2exe
    import sys
    sys.argv.append("py2exe")
    setup(console = [{"script":'test.py'}])
    OS = win xp pro
    python = 2.3.4

    thanks for advice,
    ah new
  2. #2
  3. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    538
  4. #3
  5. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    That's what I was going to tell him he needed. Only when you convert your program from .py to .exe, all you need is python23.dll (etc), you don't need the other files that came with it?
  6. #4
  7. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    538
  8. #5
  9. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    13
    Py2exe makes a very good guess at what you need to distribute with your program

    Normally you are required to distribute everything that is found in the dist sub-directory. You may be able to leave a few files (try experimenting) but you will need the .exe, .zip and any dll or .pyd you find there.

    You can consider leaving out w9xpopen.exe if you know it won't be running on a Win 98 machine.

    grim
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    40
    Rep Power
    10
    yeah! it's work!!
    thank you guys..
    pabloj + tyeggt + grim
    happy new year
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    25
    Rep Power
    0
    On most versions of linux and unix the OS will not allow exe's to be run.

IMN logo majestic logo threadwatch logo seochat tools logo