On 05/12/2018 02:30, 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
On Wed, 5 Dec 2018 at 07:57, Peter Otten <__pete...@web.de> wrote:
>
> Oscar Benjamin wrote:
> >
> > I'm looking to import a module given a string representing the path to
> > the .py file defining the module.
>
> I am not aware of a clean way. I have used
>
> def guess_modulename(filename):
>
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