Page 3 of 3 First 123
  • Jump to page:
    #31
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    4
    Rep Power
    0
    Anyone has a nice py2exe "MySetup.py" example file which contains the right source for including TKinter GUI?

    Many thanx in advance.
  2. #32
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    5
    Rep Power
    0

    thank you


    great info
  4. #33
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    1
    Rep Power
    0

    help please


    can help me with python assignment please... ??!?!
    2 days from now ,email me if yes
  6. #34
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    6
    Rep Power
    0
    The step-by-step guide was very clear and simply put!
  8. #35
  9. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    610
    Rep Power
    65

    cx_freeze for Python3


    If you want to use a py2exe type approach to Python3 code, the you have to use cx_freeze. Here is an example ...
    Code:
    """ con_setup2.py
    
    Using cx_freeze with Python33 to package a console
    program to an executable file (.exe in Windows OS).
    
    Might want to put a console-wait-line in at the end of your program.
    
    Put this setup program and your console program file into the same
    directory.  Change the filename in this setup program and also edit
    name, version and description in setup() if you so desire.
    
    A directory 'build' is created with a subdirectory 'exe.win32-3.3'
    containing all the files needed for distribution including the
    .exe file named after the console program file.
    
    The total distribution has a size of about 4.8 Mb.
    this includes the Python33.dll interpreter
    and some small pyds and a zip file
    
    I used:
    http://cx-freeze.sourceforge.net/
    cx_Freeze-4.3.1.win32-py3.3.msi
    
    tested with Python33
    """
    
    from cx_Freeze import setup, Executable
    import sys
    
    sys.argv.append("build")  # replaces commandline arg 'build'
    
    # change the filename to your program file
    filename = "HelloWorld.py"
    
    setup(
        name = "Hello World",
        version = "1.0",
        description = "console cx_Freeze script",
        executables = [Executable(filename)])
    Here is the utterly simple sample Python script ...
    Code:
    # HelloWorld.py
    
    print("Hello World!")
    
    input("Press enter to go on ...")
    Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25
  10. #36
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    15
    Rep Power
    0
    Very helpful!
  12. #37
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    13
    Rep Power
    0
    Is there are any way to bundle all files except the .exe , because once I convert my .py program the py2exe creates 9 files and I want to keep only the .exe file and bundle all others in a archive.

    Edit: I found it -

    from distutils.core import setup
    import py2exe, sys, os

    sys.argv.append('py2exe')

    setup(
    options = {'py2exe': {'bundle_files': 1}},
    windows = [{'script': "build.py"}],
    zipfile = None,
    )
    "3 (default)
    don't bundle
    2
    bundle everything but the Python interpreter
    1
    bundle everything, including the Python interpreter"
  14. #38
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    5
    Rep Power
    0
    Pardon my ignorance, but the link just leads me to a blank page, saying if you need help post on the forums?

    And will this work for python 3.1?
  16. #39
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    6
    Rep Power
    0
    I've had trouble with this before, you made it very clear - thanks!
  18. #40
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Location
    Burlinton, VT
    Posts
    33
    Rep Power
    2
    Link seems to be broken. I can't get acces to it
Page 3 of 3 First 123
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo