对不起一直不用中文编写python,我用的是2.7.4,也没有中文的需要,看了下,我的问题出在直接用print打印dict时的方法不支持中文的,所以下面是改进:# coding=utf-8
import os, sys
s = '''现在 1132 12312
明天中午 132131 1241'''
lines = s.splitlines()
list1 = []
while not lines == []:
lineT = lines.pop()
if not lineT == "":
tuplet = ( lineT.split( " ", 1 )[0].strip(), lineT.split( " ", 1 )[1].strip() )
list1.append( tuplet )
dict1 = dict( list1 )
for keys in dict1.keys():
print ( "key:[%s] Value:[%s]" % ( keys, dict1[keys] ) )
os.system( "pause" )