所以如果說
#-*- coding: utf-8 -*-
import pprint
pp=pprint.PrettyPrinter(indent=4)
wordlist=['中文','輸入']
strz='這是中文輸入法'
pp.pprint(wordlist)
print wordlist
print repr(wordlist)
print ''.join(wordlist)
for i in wordlist:
if i in strz:
print 'Go'
要把他轉成str才可以print
執行結果
peicheng@PCsNB ~/project/python/gaisrec $ python test.py
['\xe4\xb8\xad\xe6\x96\x87', '\xe8\xbc\xb8\xe5\x85\xa5']
['\xe4\xb8\xad\xe6\x96\x87', '\xe8\xbc\xb8\xe5\x85\xa5']
['\xe4\xb8\xad\xe6\x96\x87', '\xe8\xbc\xb8\xe5\x85\xa5']
中文輸入
Go
Go
沒有留言:
張貼留言