我试图在运行脚本时包含一些 IPython 内置魔法函数来自动重新加载模块。所以我试过这个:
if __IPYTHON__:
%load_ext autoreload
%autoreload 2
Run Code Online (Sandbox Code Playgroud)
但 IPython 返回:
%load_ext autoreload
^
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)
知道如何解决这个问题吗?