namespace confusion

Steve Holden sholden at holdenweb.com
Wed Aug 8 09:24:56 EDT 2001


first.py needs to include a DEFINITION of functfirst, not a call of it. THe
program as you show it should give you a NameError in main.py when you try
to call functfirst().

If not, post the exact error messages you are getting (I assume you have
simplified somewhat in your original post).

regards
 Steve
--
http://www.holdenweb.com/


"Mark Robinson" <m.1.robinson at herts.ac.uk> wrote in message
news:3B7135E2.40701 at herts.ac.uk...
> Trivial question I think.
>
> I have a program that is organised in three files as follows:
>
> #main.py
> #########
>
> from first import *
> from second import *
>
> functfirst() #from first
> functSecond() #from second
>
> ########################
>
> #first.py
> ##########
>
> functfirst()
>
> ************
>
> #second.py
> ##########
>
> from first import *
>
> def functCecond():
> functfirst() #
>
> -----------------------------------------------
>
> The problem I am having is I can't access the functfirst() from
> second.py. It makes no differce if I import it or not. What am I doing
> wrong or not doing that I should?
>
> blobby
>





More information about the Python-list mailing list