pycharm无法正常引入自定义类
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.
这是因为,pycharm 是从source目录作为根目录进行查找的,如果想要正常引包
右键项目->Make Directory as ->Sources Root
pickle.UnpicklingError: the STRING opcode argument must be quoted
在使用pickle.load()的时候,使用不当会报错:
主要要考虑的情况如下:
- 打开文件时候是否是以“rb”形式打开:
正确形式:
import pickle
with open(filePath, "rb") as input_file:
content = pickle.load(input_file)
- 是否是因为pickle文件的版本和使用的python版本不同:
也就是说,比如使用python2.7生成的pickle文件,想用python3.6来取出内容
处理方法:
imp