"Steven D'Aprano" <[EMAIL PROTECTED]> writes:

> On Tue, 31 Oct 2006 11:00:52 +1100, Ben Finney wrote:
>
> > If you want a solution that gives you an actual module object,
> > here's what I use:
> > 
> >     def make_module_from_file(module_name, file_name):
> >         """ Make a new module object from the code in specified file """
>
> The only advantage (or maybe it is a disadvantage?) I can see to
> your function is that it doesn't search the Python path and you can
> specify an absolute file name.

Which is exactly what the OP asked for (though he didn't necessarily
need a module object).

-- 
 \        "We have to go forth and crush every world view that doesn't |
  `\             believe in tolerance and free speech."  -- David Brin |
_o__)                                                                  |
Ben Finney

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to