How can I access Python's string constants ?
I need to get a list of punctuation marks which Python docs say are in string.punctuation
This won't work
''.punctuation
''.get_value("punctuation")
Is what I'm trying even possible?
string in string.punctuation isn't referring to type str, but to a string module:
In [32]: import string
In [33]: string.punctuation
Out[33]: '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
Like so:
>>> import string
>>> string
<module 'string' from '/usr/lib/python2.7/string.pyc'>
>>> string.punctuation
'!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With