Why do my Python scripts sometimes not run?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ken Marsh
    New Member
    • Jun 2011
    • 1

    Why do my Python scripts sometimes not run?

    I'm using IDLE (Python GUI) 2.5.1

    I open the Python Shell
    >File
    >New Window
    I type in my script
    >Run
    >Run Module

    If IDLE was just started, my script runs fine. After editing my script a few times, the Python shell sometimes just says

    ======= Restart =======
    >>>

    even though the exact same script runs fine other times.

    I also noticed that when I experience this problem, and open up task manage, there are a few instances of the program running, which I have to end manually. Another problem I have when this happens is that, after exiting the Shell and editor, I have to go into task manager and close each instance of Python manually or else it won't let me start it up again.

    The programming book I'm reading uses IDLE for every example, in which they encourage the reader to follow along. I wanted to be able to do that.
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    "======= Restart =======" indicates the environment was restarted so your revised script can be imported. Otherwise, your script would have to be reimported with reload(). I don't know why you end up with multiple process running unless errors are not handled properly (just guessing). Try using another IDE like Pythonwin.

    Comment

    Working...