# -*- coding:UTF-8 -*-
import codecs
import os
import re
import subprocess
import sys
import threading
import time
class TestSubprocess(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.loop=True
def run(self):
counter=0
while self.loop:
time.sleep(2)
counter+=1
print counter
def stop(self):
self.loop=False
if __name__=="__main__":
t=TestSubprocess()
t.start()
time.sleep(10)
t.stop()
先附小例子,有时间在写
SubProcess用法
最新推荐文章于 2024-02-28 17:48:52 发布