Import module from file path

2018-12-04 Thread Oscar Benjamin
Hi all, I'm looking to import a module given a string representing the path to the .py file defining the module. For example given this setup mkdir -p a/b/c touch a/__init__.py touch a/b/__init__.py touch a/b/c/__init__.py touch a/b/c/stuff.py I have a module a.b.c.stuff which is defined in the

Re: Import module from file path

2018-12-04 Thread Peter Otten
Oscar Benjamin wrote: > Hi all, > > I'm looking to import a module given a string representing the path to > the .py file defining the module. For example given this setup > > mkdir -p a/b/c > touch a/__init__.py > touch a/b/__init__.py > touch a/b/c/__init__.py > touch a/b/c/stuff.py > > I hav