importing with .m instead of .py

Wanderer wanderer at
Fri Sep 25 21:55:27 CEST 2009

On Sep 25, 2:05 pm, Andrew Svetlov <andrew.svet... at> wrote:
> On Sep 25, 1:16 pm, Wanderer <wande... at> wrote:
> > execfile(x) does what I'm looking for.
> Perhaps you are looking for Python import hook:
> In you import hook you can do everything (and locate/import file with
> any extension :)

I'm just porting a bunch of octave functions into pylab that use data
I collected in files like I show above. The execfile() method lets me
verify I get the same results in Octave and Python. It is in the NumPy
for Matlab users page at Mathesaurus,
but they make it look like it needs a .py extension. Like Ishwor said
'Trivial', now that I know how :)

More information about the Python-list mailing list