[Tutor] basic import question

tpc@csua.berkeley.edu tpc@csua.berkeley.edu
Tue Jul 8 14:16:01 2003


I am a beginner, but I will hazard because your call is outside the scope
of the function definition ?

On Tue, 8 Jul 2003, Chris Kassopulo 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
>