On 26 February 2011 11:06, Corey Richardson <kb1...@aim.com> wrote: > I ran them like this: > python use1.py > python use2.py > python plib.py > > Each file got its own instance of the interpreter. >
Yes, but not because instances are intrinsically linked to seperate python modules, which is what it sounds like you're saying. In the above case you *explicitly* started the 3 python instances seperately yourself from the command line, giving each instance a file to run, which is why you got 3 seperate instances. It's nothing to do with the fact that you have 3 files as such. (You'd have had 3 instances even if you ran the same file 3 times.) If you e.g. ran "use1.py" which then imported or ran use2.py and use3.py they'd all have used the same instance. Similarly, if you'd opened all 3 files in IDLE, and ran them with F5 in turn, they'd all have run in the *same* interpreter instance. Perhaps you do understand and you've expressed yourself poorly or I've just miinterpreted what you meant, I just wanted to make sure you don't think that seperate files (modules) will by some magic always have their own instances (which is not the case in general.) Walter
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor