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

    Join Date
    Aug 2013
    Location
    Burlinton, VT
    Posts
    30
    Rep Power
    1

    Help with PY2EXE


    Hi,

    So I installed python on my windows machine, which I already don't like. But I did it because I need to convert my python program to a windows executable file. I included Python to my system path, so I am working from CMD.

    I was trying to follow the very simple tutorial from the py2exe webpage and when I get to the step of creating the setup.py file, python just closes and it doesn't create the file, I dont get any error so I have no idea what's going on.

    Code:
      
    1 from distutils.core import setup    
    2 import py2exe    
    3     
    4 setup(console=['hello.py'])
    when I execute line 4, python closes and the file setup.py is not created.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Location
    Burlinton, VT
    Posts
    30
    Rep Power
    1
    I decided to add more information of everything I am doing so people might be able to help.

    I open cmd.

    Code:
    cd C:\Users\eda\Desktop\Tutorial
    python hello.py (works)
    python
    
    from distutils.core import setup    
    import py2exe    
         
    setup(console=['hello.py'])
    setup.py is not created, no error, cmd just closes... might this be an administrator rights issue????? thank you.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    191
    Rep Power
    2
    You need to actually create and save a file with those contents; not try to run it from the interactive interpreter.


    Open your favorite code editing word-processor/IDE. IDLE will work fine if that is all you have. Create new file. Paste in the setup script. Save as setup.py.


    Then open a command prompt. Navigate to that directory. And run:
    Code:
    python setup.py py2exe
    -Mek
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Location
    Burlinton, VT
    Posts
    30
    Rep Power
    1
    Originally Posted by Mekire
    You need to actually create and save a file with those contents; not try to run it from the interactive interpreter.


    Open your favorite code editing word-processor/IDE. IDLE will work fine if that is all you have. Create new file. Paste in the setup script. Save as setup.py.


    Then open a command prompt. Navigate to that directory. And run:
    Code:
    python setup.py py2exe
    -Mek
    simple and makes rational sense.... Thank you.

IMN logo majestic logo threadwatch logo seochat tools logo