How to call module functions inside class instance functions?

beginner zyzhu2000 at gmail.com
Sat Aug 18 20:40:41 EDT 2007


Hi Everyone,

I have encountered a small problems.  How to call module functions
inside class instance functions? For example,  calling func1 in func2
resulted in a compiling error.

"my module here"

def func1():
     print "hello"

class MyClass:
   def func2():
         #how can I call func1 here.
         func1() #results in an error


Thanks,
Geoffrey




More information about the Python-list mailing list