Re: newb: Python Module and Class Scope

2007-05-11 Thread Duncan Booth
Dave Baum <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > johnny <[EMAIL PROTECTED]> wrote: > >> scope of "def main()" interms of class A? >> >> myModule: >> >> class A: >>main() >> >> def main(): >> > > Yes, class A can access main. The name "main" will be defined at th

Re: newb: Python Module and Class Scope

2007-05-11 Thread Dave Baum
In article <[EMAIL PROTECTED]>, 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: > > cl

Re: newb: Python Module and Class Scope

2007-05-10 Thread Duncan Booth
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(

Re: newb: Python Module and Class Scope

2007-05-10 Thread rishi pathak
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.

newb: Python Module and Class Scope

2007-05-10 Thread johnny
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/pyt