|
我的跟楼主的一样,二楼说的对,我的没有这个函数。
- >>> from string import maketrans
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- ImportError: cannot import name 'maketrans'
- >>> import string
- >>> dir(string)
- ['Formatter', 'Template', '_ChainMap', '_TemplateMetaclass', '__all__', '__built
- ins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__packag
- e__', '__spec__', '_re', '_string', 'ascii_letters', 'ascii_lowercase', 'ascii_u
- ppercase', 'capwords', 'digits', 'hexdigits', 'octdigits', 'printable', 'punctua
- tion', 'whitespace']
复制代码 |
|