Jump to content

Python: name not defined.

ragmop12's Photo
Posted Sep 20 2010 08:39 AM
4937 Views

In Python, got an error message but do not understand it.

PYTHON ERROR MESSAGE *****************************

>>> NMFUTPOPS.py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'NMFUTPOPS' is not defined
>>>

END OF PYTHON ERROR MESSAGE **********************

What does this mean, "not defined"?

How do I define it?

How do I correct it? THANKS. Alan Stewart

Tags:
0 Subscribe


1 Reply

0
  GT_Fish's Photo
Posted Sep 30 2010 03:05 PM

I'm guessing that NMFUTPOPS.py is the name of a file containing a python script. You can get python to "process" a file containing a script by running:

python NMFUTPOPS.py


In your message you show ">>>", this is python's interactive prompt. In this mode you can enter python statements that python will process. For example:


$ python
>>> print "Hello World"
Hello World
>>> ^D


Press ctrl-D to finish.

I hope this helps.