根据文档,string.punctuation包含:String of ASCII characters which are considered punctuation characters in the C locale.
如果我打印string.punctuation,我会得到!"#$%&'()*+,-./:;<=>?@[]^_`{|}~
我是否可以相信这个字符串总是相同的,因为它包含所有的ASCII标点符号字符,或者区域设置对此是否很重要?
(我在带有LANG=en_US.UTF-8的xubuntu12.04上使用Python2.7)
发布于 2014-01-12 06:08:17
是-除非将来对ASCII或C语言环境进行更改(可能性很小),否则该字符集应该保持不变。
https://stackoverflow.com/questions/21068454
复制相似问题