文章

更丝滑的使用SageMath

Linux

VScode + SageMath

WSL视为Linux,应该可以相同方法使用

  • Vscode安装SageMath Enhanced插件-github
  • 该插件提供了sage代码高亮,缓存文件自动清理等功能
  • 直接新建 .sage文件然后在vscode中正常编辑
  • 右上角点击Run SageMath File即可调试

Windows

VScode + Jupyter + SageMath

  • 由于在Windows上不能通过命令行窗口直接运行sage文件,这就导致了上述的插件解决方法无法奏效。
  • 这里的解决方法是使用VScode远程连接Jupyter内核
  • 由于每次打开Jupyter内核都会生成token,VScode需要反复重新连接
  • 对SageMath 9.3 Notebook快捷方式属性修改
  • 在目标末尾加上--NotebookApp.token='' --no-browser
  • 双击打开后用VScode连接Jupyter内核http://localhost:8888/

0 条评论