[Tutor] basic import question

Chris Readle patterner@rocketmail.com
Tue Jul 8 14:36:20 2003


I'm stilla newb myself so this may not be correct, but my understanding of
import was that the act of importing does not, imply a call to the
imported function (or functions).  Put another way, if you're importing an
object that has several methods, you certainly wouldn't want the import to
assume that you wished to call *all* of the methods, but rather you'd
import the functionality of the object and then make calls to the various
methods.

chris

--- Chris Kassopulo <ckasso@sprynet.com> wrote:
> Greetings,
> 
> A very basic question occurred to me:
> 
> def main():
>     print "hello world"
> main() 
> 
> If "import mymain" runs mymain completely from the
> top down, why doesn't this run twice, once for the
> import and once for the call ?
> 
> >>> import mymain
> hello world
> >>> 
> 
> Chris
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com