【python】 判断纯ascii串

参考:http://stackoverflow.com/questions/3636928/test-if-a-python-string-is-printable

print all(ord(c)<127and c in string.printable for c in input_str)

  

 
posted @ 2014-01-06 10:59  liyuxia713  阅读(734)  评论(0编辑  收藏  举报