发布时间:2014-05-05 10:07:32
#coding=utf-8 s="中文" if isinstance(s, unicode): #s=u"中文" print "s1=",s.encode('gb2312') else: #s="中文" print "s2=",s.decode('utf-8').encode('gb2312')......【阅读全文】
发布时间:2014-05-05 09:53:44
下面是unittest模块的常用方法:assertEqual(a,b) a == b assertNotEqual(a,b) a != b assertTrue(x) bool(x) is True assertFalse(x) boo.........【阅读全文】