1

I use Python 3.1 inside Windows XP and when I try to use more than one module at the same time, the Python shell restarts. What can I do?

This is my module benutzer.py:

class Benutzer(object):
    def __init__(self,benutzer):
        self.name =  benutzer
        self.email = None

    def setzeEmail(self, adresse):
        self.email = adresse

When I do "Run Module" inside IDLE, the shell says RESTART.

Pi Delport
  • 10,356
  • 3
  • 36
  • 50
KayJay
  • 11
  • 1
  • 3

2 Answers2

4

IDLE restarts Python to make sure your module gets reloaded properly, because this can sometimes be problematic. This is normal and nothing to be concerned about; it won't happen for other uses of your module.

kindall
  • 178,883
  • 35
  • 278
  • 309
0

There is something that can be done about it. Rather than running your modules by hitting F5 or clicking run you can load them via exec(open("other_script.py").read()) as explained here: How to prevent python IDLE from restarting when running new script

Community
  • 1
  • 1
Cornelius Roemer
  • 3,772
  • 1
  • 24
  • 55