擅长:python、mysql、java
<p>基本上,您所指的问题/答案是您需要的:</p>
<pre><code>import threading import time
interesting = 0
class MonitorThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
global interesting
while(1):
print interesting
time.sleep(1)
MonitorThread().start()
for interesting in range(2000000):
time.sleep(1)
</code></pre>