I want to use the sign function. When I use it in in-line mode works pretty 
well:

   : sign(-20)
   : -1

However, I wrote the following code in a file, say, pp.py

def tst(x):
    s = sign(x)
    return(s)

Then I tried to import into my session:

  : from pp import *

When I try to use tst, this is what I get:

  ------------------------
  Traceback (most recent call last):
    File "<ipython console>", line 1, in <module>
    File "pp.py", line 9, in tst
      s = sign(x)
  NameError: global name 'sign' is not defined


Do you have any idea why is this happening?


Thanks,

 -- Sergio.


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

Reply via email to