>>> g.nodes() [u'1', u'2', u'34', u'59', u'57'] >>> for node in g.nodes(): print node
Traceback (most recent call last): File "<pyshell#201>", line 2, in <module> print node File "/usr/lib/python2.6/idlelib/rpc.py", line 597, in __call__ value = self.sockio.remotecall(self.oid, self.name, args, kwargs) File "/usr/lib/python2.6/idlelib/rpc.py", line 210, in remotecall seq = self.asynccall(oid, methodname, args, kwargs) File "/usr/lib/python2.6/idlelib/rpc.py", line 225, in asynccall self.putmessage((seq, request)) File "/usr/lib/python2.6/idlelib/rpc.py", line 324, in putmessage s = pickle.dumps(message) File "/usr/lib/python2.6/copy_reg.py", line 70, in _reduce_ex raise TypeError, "can't pickle %s objects" % base.__name__ TypeError: can't pickle PySwigObject objects >>> for node in g.nodes(): print type(node) <class 'pygraphviz.agraph.Node'> <class 'pygraphviz.agraph.Node'> <class 'pygraphviz.agraph.Node'> <class 'pygraphviz.agraph.Node'> <class 'pygraphviz.agraph.Node'> and this problem is weird, when I run python script.py it did not show warning. well, on the same version idle, it showed above error message. Thanks _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor