This must be a trivial question:

I have "import numpy as np" in the python startup file.

A file called mod1.py contains "def myfn..."
 and inside myfn there is a call to, say, "np.convolve".

Interactively:
>python
.... (numpy imported as np)

>import mod1
>
>mod1.myfn(...)

Error: global name "np" is not known.
=======
Why is "np" not known to functions in an imported module ?
=======

I can fix this by including "import numpy as np" in any module that uses numpy
functions -- but then what is the point of having a startup file?

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

Reply via email to