This works for me.Also tried importing this module into another program.
The class is inside the module so like the different function's of a module
can access each other,the same thing applies to a class and
functions/classes
#Test Module
class foo:
def __init__(self):
self.data=1
def outData(self):
print self.data
main()
def main():
print "I am the main"
#Module test
if __name__=="__main__":
fooObj=foo()
fooObj.outData()
On 10 May 2007 07:02:49 -0700, johnny <[EMAIL PROTECTED]> wrote:
Can a class inside a module, access a method, outside of class, but
inside of the module?
Eg. Can instance of class a access main, if so how? What is the
scope of "def main()" interms of class A?
myModule:
class A:
main()
def main():
thnx.
--
http://mail.python.org/mailman/listinfo/python-list
--
Regards--
Rishi Pathak
National PARAM Supercomputing Facility
Center for Development of Advanced Computing(C-DAC)
Pune University Campus,Ganesh Khind Road
Pune-Maharastra
--
http://mail.python.org/mailman/listinfo/python-list