Microsoft
Software
Hardware
Network
Question : global name 'do_traceroute' is not defined?
I got the error message: "NameError: global name 'do_traceroute' is not defined". Can anyone help me find what is wrong with my python code below?
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
import thread
import os
class Connecter:
... ...
def do_traceroute():
os.system('traceroute
www.google.com'
)
... ...
def got_message(self, connection, message):
... ...
print 'Here is a test!'
thread.start_new(do_tracer
oute, ())
... ...
Answer : global name 'do_traceroute' is not defined?
Because
do_traceroute() is a method of your class, you need to say:
1: 2: 3:
def got_message(self, connection, message): ... thread.start_new(self.do_traceroute, ())
Open in New Window
Select All
Random Solutions
Convert C-ISAM files either to Access or SQL
Find domino server time
wmv embedded in Flash 8 plays too fast
Need Linux Antivirus software for Fedora core 6
Is this SuperBase ? Can I dump the tables ?
MSExchangeSA Event ID: 9335 (After removing a backend server)
DC Diag errors- Replacing an old DC with a new server.
SBS 2003 Cold Backup and Restore using NTBackup.exe
How to Subtract 14 hours from GetDate()
internet explorer drop down is showing recent file locations