Python 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0 20170118] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> s = raw_input() 阿斯蒂芬 >>> print 'name', s name 阿斯蒂芬 >>> print s.decode('utf8') 阿斯蒂芬 >>>
第2个回答 2013-05-03
from struct import * # 把你这上面代码加上去 print unpack('30b', pack('30s', s))