Perhaps __init__.py has what you're looking for? THN
[EMAIL PROTECTED] wrote: > I just started working with Python and ran into an annoyance. Is there > a way to avoid having to use the "from xxx import yyy" syntax from > files in the same directory? I'm sure it's been asked a million times, > but I can't seem to find the answer. > > For example, I have two classes stored in separate files as such. > > File: one.py > ======== > class One: > def methodA(self): > print "class One" > def methodB(self): > print "class One" > > > File two.py > ======== > from one import One > > class Two(One): > def methodA(self): > print "class Two" > > if __name__ == "__main__": > x = Two() > x.methodA() > x.methodB() > > When I run the Two.py file, I get the expected output but I'd like to > eliminate the from line in two.py. -- http://mail.python.org/mailman/listinfo/python-list