标签:字符串
#!/usr/bin/env python
import multiprocessing
import time
# print "The time is {0}".format(time.ctime())
# print time.ctime()
# print "The time is {0}".format
# print ‘this is {}‘.format(‘pangf‘)
# print ‘that is {0},{1}‘.format(‘hello‘,‘world‘)
# print ‘that is {1},{0},{2}‘.format(‘name‘,‘fdf‘,‘000‘)
# print time.ctime()
# print ‘that is {name}‘.format(name=‘pdbbb‘)
def worker(interv):
n = 5
while n>0:
print ‘the time is {}‘.format(time.ctime())
time.sleep(interv)
n -= 1
if __name__ == ‘__main__‘:
p = multiprocessing.Process(target = worker,args = (3,))
p.start()
print "p.pid:",p.pid
print ‘p.is_alive:‘,p.is_alive()
# pass
本文出自 “庞飞” 博客,谢绝转载!
标签:字符串
原文地址:http://pangfei.blog.51cto.com/8832397/1854151