参考: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)
参考: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)
转载于:https://www.cnblogs.com/liyuxia713/p/3506780.html