> Okay here comes the next question.
>
> In that class, I have 3 functions. Actually, one of them calls the
two
> others.

You have 3 methods, functions and methods are similar but different!
If you think of them asthe same thing you will probably get
confused by OOP later on!

> However when I call these functions (wich are placed before the
caller
> in the file), I get an error saying that the global name x (the
function
> name) is not defined.

WE could do with some code to show how you do that, and definitely
cut n paste the error report. Python error reports are very helpful
in tracing issues.

> What am I doing wrong?

Without code or error report I can only make a wild guess.
Are you remembering to precede the method name with the object name?

ie

from myModule import MyClass  # get access to the class
myobject = MyCLass()          # create an object from the class
myobject.myMethod()   # send message to the object to call myMethod

Alan G
Author of the Learn to Program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to