码迷,mamicode.com
首页 > 编程语言 > 详细

python字符串format

时间:2016-09-19 22:42:13      阅读:173      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!