Pycharm 版本 2017.1
Python 版本 3.6
导入包 import time , import os ,import re 等等均正常。
唯独导入 import string 时 Pycharm 却提示:
Unused import statement less... (F1) This inspection detects names that should resolve but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items.
忽略这个提示: 使用 str.strip() 对字符串进行处理,程序正常运行,但是返回的结果并没有去除换行符。
在终端 运行 import string str.strip(),可以正常去除换行符。
求解
