我从python 2.7切换到python 3.3时遇到了一个问题。我用spyderlib,但现在升级到spyder。因此,我已经修改了我的代码将所有变量保存到下面一个spydata数据:使用spyder库将所有变量保存到spydata文件
from spyder.utils.iofuncs import save_dictionary
def variablesfilter():
from spyder.widgets.variableexplorer.utils import globalsfilter
from spyder.plugins.variableexplorer import VariableExplorer
from spyder.config.base import get_conf_path, get_supported_types
data = globals()
settings = VariableExplorer.get_settings()
get_supported_types()
data = globalsfilter(data,
check_all=True,
filters=tuple(get_supported_types()['picklable']),
exclude_private=settings['exclude_private'],
exclude_uppercase=settings['exclude_uppercase'],
exclude_capitalized=settings['exclude_capitalized'],
exclude_unsupported=settings['