VSCode中设置用IPython运行Python代码

VSCode中设置用IPython运行Python代码

在IPython中运行所选的代码:

在设置中, 找到python.terminal.launchArgs这一项, 设置为如下内容.
"python.terminal.launchArgs": [
   "-m",
   "IPython",
   "--no-autoindent",
]

在IPython中自动重载模块:

https://stackoverflow.com/questions/35037815/how-to-automatically-reload-modules-in-ipython

复制代码
Step 1: Make sure you have the latest ipython version installed
$ ipython --version
Step 2: find out where your config file is
$ ipython profile create
Step 3: Open the config file with an editor based on the location of your config file. I use atom. For example:
$ atom ~/.ipython/profile_default/ipython_config.py
Step 4: Look for the following lines in the config file:
c.InteractiveShellApp.extensions = []
change it to:
c.InteractiveShellApp.extensions = ['autoreload']
and then uncomment that line
find:
c.InteractiveShellApp.exec_lines = []
change it to:
c.InteractiveShellApp.exec_lines = ['%autoreload 2']
and then uncomment that line
Done.
复制代码

 

posted @   酱_油  阅读(1042)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· 上周热点回顾(2.17-2.23)
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 如何使用 Uni-app 实现视频聊天(源码,支持安卓、iOS)
历史上的今天:
2019-07-04 pybind11和numpy进行交互
点击右上角即可分享
微信分享提示