> Any ideas? If I do something like "import math" in the subfunction, > then the error changes to "global name 'math' is not defined".
Presumably ipython does an import so you need to import it yourself something like: from math import sqrt at the top of your source file. I don't know why math would not be defined, it's built in -- probably a scoping logic problem in your code. Put the form/import statement at the top of your module file (as is usually done), not inside a function or other block. Rob -- http://mail.python.org/mailman/listinfo/python-list