On Tue, Feb 9, 2010 at 2:06 PM, mukesh tiwari <mukeshtiwari.ii...@gmail.com>wrote:
> Could some one please tell what is wrong with this code. I am trying > to use Queue in this program but i am getting error > Traceback (most recent call last): > File "/home/user/NetBeansProjects/NewPythonProject2/src/ > Pollard_rho.py", line 80, in <module> > factor(n) > File "/home/user/NetBeansProjects/NewPythonProject2/src/ > Pollard_rho.py", line 59, in factor > Q_1=Queue() > NameError: global name 'Queue' is not defined. > That's because you haven't imported the Queue module. You need to do: import Queue Then call: Q_1 = Queue.Queue() Alternately, you can do: from Queue import Queue And instantiate the class the same way you previously were. --S
-- http://mail.python.org/mailman/listinfo/python-list