DEV Community

IQIUM
IQIUM

Posted on

VScode 模块调试

背景

当我在一个python项目中的时候,每次想要运行这个train.py代码,但是有的项目用的相对路径,这个时候就很难处理(除非把所有的相对路径改成绝对路径)

解决方法

由于vscode的调试机制采用的是:在当前文件夹下处理,也就是工作目录(就是我们用vscode 打开的哪个文件夹),那么一个处理方式就是打开两个工作区

  1. 安装 ctrl + shift + p, 输入命令add folder to workspace,选择需要的目录
  2. 修改launch.json 文件进行模块调试

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay