How do you import a module with "." in its filename?

Andrew P. Lentvorski bsder at mail.allcaps.org
Tue Jul 30 21:49:50 EDT 2002


I have several files:

a.test.py b.test.py c.test.py

which carry out regression tests for their respective modules (a.py, b.py,
c.py).  I would like to create an overall module called alltests.py.
However, when I try to do:

import a.test

in alltests.py, Python gets all huffy since "." is its separator for
module hierarchy.

So, how do I import a module with "." in its filename?

For both practical and political reasons, renaming a.test.py to a_test.py
is not an option.

-a





More information about the Python-list mailing list