在Visual Studio Code中使用如下的配置来运行python虚拟环境,结合coderunner来运行代码,脚本
{
"python.pythonPath": "E:\\Flasky_my\\v_env\\Scripts\\python.exe",
"python.venvPath": "E:\\Flasky_my\\v_env",
"python.venvFolders": [
"v_env",
".pyenv",
".direnv",
".env"
],
"code-runner.executorMap": {
"python":"E:\\Flasky_my\\v_env\\Scripts\\python.exe"
},
"code-runner.runInTerminal": true
}
Windows 下的Visual Studio Code终端powershell格式很乱,不对齐
解决方法一:
打开终端-属性-使用旧版控制台勾上,重启VsCode,问题可以解决
解决方法二:
使用Git base:
# settings.json
"terminal.integrated.shell.windows": "E:\\Git\\bin\\bash.exe"
Windows上的默认终端为powershell
C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
VScode coderunner
输出中文乱码问题:
参考:
https://www.cnblogs.com/zhaoshizi/p/9050768.html
code-runner.executorMap": {
....
"python": "set PYTHONIOENCODING=utf8 && python",
....
}
VScode 的用户设置与工作空间设置
VScode的用户设置与工作空间