Ben Finney wrote: > Howdy all, > > Question: I have Python modules named without '.py' as the extension, > and I'd like to be able to import them. How can I do that?
This is a piece of cake in Python. >>> from types import ModuleType >>> x = ModuleType('myModName') >>> data = open('myfilename').read() >>> exec data in x.__dict__ Your output here... This won't save a .pyc, but as your message later explains, this is for unittesting, so this could probably be considered a feature for this usage. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list