Re: Importing a file (not a module).

2009-02-09 Thread Hendrik van Rooyen
"Luis Zarrabeitia" wrote: >Is there any way to "import" a .py file that is not on sys.path? >I'd like to 'import' a file that resides somewhere on my filesystem without >having to add it's directory to sys.path. At first, I thought that something like > >my_module = __import__("path/to/file") > >

Re: Importing a file (not a module).

2009-02-08 Thread Steve Holden
Luis Zarrabeitia wrote: > Is there any way to "import" a .py file that is not on sys.path? > I'd like to 'import' a file that resides somewhere on my filesystem without > having to add it's directory to sys.path. At first, I thought that something > like > > my_module = __import__("path/to/file"

Importing a file (not a module).

2009-02-08 Thread Luis Zarrabeitia
Is there any way to "import" a .py file that is not on sys.path? I'd like to 'import' a file that resides somewhere on my filesystem without having to add it's directory to sys.path. At first, I thought that something like my_module = __import__("path/to/file") would work, but I was mistaken.