发布时间:2013-12-18 23:35:26
import threadingimport time,randomclass ThreadLocal(threading.Thread): def __init__(self): threading.Thread.__init__(self) .........【阅读全文】
发布时间:2013-12-18 23:22:40
import threadingimport timeclass ThreadTest(threading.Thread): def __init__(self,index,create_time): threading.Thread.__init__(self) &n.........【阅读全文】
发布时间:2013-12-18 23:20:15
import threadingimport timeclass ThreadTest(threading.Thread): def __init__(self,index,create_time): threading.Thread.__init__(self) &n.........【阅读全文】
发布时间:2013-12-18 22:40:26
#!/usr/bin/env python#coding:utf8import subprocessimport signal#信号处理函数,打印一段话def sigint_handler(signum,frame): print "In signal SIGINT handler"#注册信号。signal.signal(signal.SIGINT,sigint_handler)ping = subprocess.Popen(args="pin.........【阅读全文】
发布时间:2013-12-18 21:53:56
subprocess特点: 调用外部系统命令创建新的子进程 能够使用input/output/error 有返回值 可以替代旧的os.system,os.popen,commands......【阅读全文】