Two Classes In Two Files

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Wed Aug 9 15:35:42 EDT 2006


dhable at gmail.com:
> Is there
> a way to avoid having to use the "from xxx import yyy" syntax from
> files in the same directory?

You can just use:
import xxx

and then:
class Two(xxx.One):
    ...

If you don't want to use the import line, you have to put the two
classes into the same module.

Bye,
bearophile




More information about the Python-list mailing list