importing as module when a file has a non-identifier name
Friday, June 12th, 2009I need to reuse a function in a file. The usual way is just to import this file as a module. But what to do if the name is “bad”? The following doesn’t work:
import foo-bar as foo_bar
foo_bar.callme()
After trials and errors, the desired magic found: