小时钟

import datetime
def hello_name(hi,name):
	hi = hi+', '+name
	print '|-'+'-'*len(hi)+'-|'
	print '| '+hi+' |'
	print '|-'+'-'*len(hi)+'-|'

	now = datetime.datetime.now()
	day = now.strftime('%Y:%m:%d %H:%M:%S')
	print 'now is {0} @{1}'.format(day,day[:4])
hello_name('Hello','Seven')

'''
|--------------|
| Hello, Seven |
|--------------|
now is 2017:12:27 18:00:37 @2017
'''

猜你喜欢

转载自blog.csdn.net/u012338816/article/details/78914952
今日推荐