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

    Join Date
    Feb 2013
    Location
    California, USA
    Posts
    74
    Rep Power
    2

    Exclamation Python programs suddenly don't run in Windows Explorer


    This problem has suddenly occurred after a few weeks of learning Python 3. Up until now, I could run my Python procedures in a DOS window by double-clicking the file in Windows 7 Explorer. Today, everything immediately opens and closes when I double-click it. I re-booted and get the same results.
    I opened a DOS window, navigated to the folder with the procedures, and typed 'python' and a procedure name, and it worked okay and did not close unexpectedly. Procedures run fine in IDLE.
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,837
    Rep Power
    480
    Sounds like an imp sneaked in overnight to play a trick on you. Change the setting of your DOS windows to remain open.
    http://www.computerhope.com/issues/ch000738.htm

    You can write your programs so that each ends after prompting "press enter to exit"
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    California, USA
    Posts
    74
    Rep Power
    2
    Thanks for the advice. I browsed through the web page but I think this was better solved through Explorer than creating shortcuts to keep Python open in the DOS window.
    The solution was to open Explorer, right-click on Python.exe, choose Properties, Compatability, and I changed 'Windows 95' to
    'Windows 7'. Now the DOS window does not immediately appear and disappear when I double-click on a module in Explorer.
  6. #4
  7. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    605
    Rep Power
    65
    pyJer, thanks for the information.
    Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25

IMN logo majestic logo threadwatch logo seochat tools logo