Re: [Tutor] Module imports

2007-07-15 Thread Kent Johnson
kevin parks wrote: > It was explained to me that it is fine to import random, sys and time > in both, and that only the first import uses up memory, and > subsequent attempts to import the same module don't really cost > anything and just add a reference in the namespace. but isn't loading

Re: [Tutor] Module imports

2007-07-11 Thread Dave Kuhlman
On Wed, Jul 11, 2007 at 08:24:17PM +0900, kevin parks wrote: > but my kp module also uses happens to call on certain things from the > random, time, and sys modules and so kp.py also has > > import random > import sys > import time > > Now so far this seems to be working fine and without error (a

Re: [Tutor] Module imports

2007-07-11 Thread Noufal Ibrahim
kevin parks wrote: > With sincere apologies for such a basic question, and one i will > admit that i asked once before, moons ago. But even after googling > around a bit i don't understand what the right answer is, or if i > once did, can't recall it now.. [..] > > For some reason i feel li

[Tutor] Module imports

2007-07-11 Thread kevin parks
With sincere apologies for such a basic question, and one i will admit that i asked once before, moons ago. But even after googling around a bit i don't understand what the right answer is, or if i once did, can't recall it now.. I have a script, let's call it foo.py This script loads sever

Re: [Tutor] module imports

2006-03-08 Thread Kent Johnson
kevin parks wrote: > so let's say i have a script called foo.py. > foo.py uses some things from the random module and therefore has > > import random > import kp > import sys > import time > > etc. & co. in it > > but foo.py also imports a module kp which also > happens to import random. > > S

Re: [Tutor] module imports

2006-03-08 Thread kevin parks
On Mar 8, 2006, at 7:09 PM, Bob Gailer wrote: > kevin parks wrote: >> i have a module called foo.py >> >> foo.py imports random >> >> kp.py imports foo.py ... but in kp.py i also need to use stuff from >> random... >> >> so kp.py also imports random >> >> but i prolly shouldn't do that right

Re: [Tutor] module imports

2006-03-08 Thread Bob Gailer
kevin parks wrote: > i have a module called foo.py > > foo.py imports random > > kp.py imports foo.py ... but in kp.py i also need to use stuff from > random... > > so kp.py also imports random > > but i prolly shouldn't do that right? > Wrong. > Cause now, haven't i needlessly copied the s

[Tutor] module imports

2006-03-08 Thread kevin parks
i have a module called foo.py foo.py imports random kp.py imports foo.py ... but in kp.py i also need to use stuff from random... so kp.py also imports random but i prolly shouldn't do that right? Cause now, haven't i needlessly copied the same names/attributes/methods/functions to 2 nam