I want to have .foo directory that contains some python code. I can't
figure out how to import code from that .foo directory. Is this even
possible?
TIA
Matt
Yes, but it's not a particularly recommended thing to do as it is
CRAZY. You can get to it from the imp module's functions:
import imp
# Loads a file/dir named .foo or .foo.py on the sys.path, giving it
the overloaded name of foo in sys.modules
imp.load_module('foo', *imp.find_module('.foo'))
# Grab the module into the local namespace, it's been imported in the
system but not here yet
import foo
Seriously. Crazy. It looks strange and hard because it is in no way a
use case that anyone expects you to have. But it's possible.