首页 > 编程语言 > 详细

python字符串format

时间:2016-09-19 22:40:55      阅读:244      评论:0      收藏:0      [点我收藏+]

#!/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


本文出自 “庞飞” 博客,谢绝转载!

python字符串format

原文:http://pangfei.blog.51cto.com/8832397/1854151

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!