您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

在emacs python shell中重新加载已更改的python文件

在emacs python shell中重新加载已更改的python文件

它似乎为我工作:

在您的PYTHONPATH中创建一个名为test.py的文件

def foo():
    print('bar')

然后在emacs python shell(或者更好的是ipython shell)中,键入

>>> import test
>>> test.foo()
bar

现在修改test.py:

def foo():
    print('baz')

>>> reload(test)
<module 'test' from '/home/unutbu/pybin/test.py'>
>>> test.foo()
baz
python 2022/1/1 18:41:39 有260人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶