python 字符框
1 #!/usr/bin/env python
2 #coding:utf8
3 width = 48
4 data = []
5 while True:
6 entry = raw_input("输入数据q退出")
7 if entry == 'q':
8 break
9 else:
10 data.append(entry)
11 print '+' + '*' * width + '+'
12 for item in data:
13 #length,extra = divmod((48 - len(item)),2)
14 print "+" +item.center(width)+ "+"
15
16 print '+' + '*' * width + '+'
~
~