摘要:
参考:http://stackoverflow.com/questions/3636928/test-if-a-python-string-is-printableprint all(ord(c)<127and c in string.printable for c in input_str) 阅读全文
摘要:
http://www.cnblogs.com/yd1227/archive/2011/03/18/1988015.html该博文写的很详细,备忘。需要注意的是,写测试脚本的时候,不要将脚本命名成跟module一样的名字,如random.py,否则会出现报错:AttributeError: 'module' object has no attribute 'randint' 阅读全文