"Rob Brown-Bayliss" <rob at ZOOstation.cc> wrote in message news:mailman.987320124.14328.python-list at python.org... [snip] > module = 'mymod' > import module > > Only, as I found out I get an error stating that there is not module > called module. > > Is this possible in python? Is there a better way perhapse? Standard module imp provides functions find_module and load_module that support this. See: http://www.python.org/doc/current/lib/examples-imp.html for Python code that uses them to mimic the import statement (without hierarchical packages) and is easy to tweak so as to decouple the diskfile name from the name you want to use for the module in your code. Alex
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4