vscode (Visual Studio Code) 配置Python 虚拟环境
2023-09-11 14:16:58 时间
配置run 运行相关
launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: 当前文件",
"type": "python",
"request": "launch",
"program": "${file}",
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"env": {"PYTHONPATH":"${workspaceRoot}"}
}
]
}
code runner 配置
settings.json
{
"python.pythonPath": "venv\\Scripts\\python.exe",
"code-runner.executorMap": {
"python": "$pythonPath -u $fullFileName",
},
"code-runner.saveFileBeforeRun": true,
"code-runner.runInTerminal": true,
// 将项目路径添加到python path变量中
"terminal.integrated.env.windows": {
"PYTHONPATH":"${workspaceRoot}"
},
// 单元测试
"python.testing.pytestArgs": [
"test"
],
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.pytestEnabled": false,
"python.testing.promptToConfigure": false
}
相关文章
- RabbitMQ延迟队列(Python版)
- Python 日期和时间_python 当前日期时间_python日期格式化
- python 去除字符串中连续的空格,并使用其他的分隔符替代连续的空格
- 【Python五篇慢慢弹】快速上手学python
- Python查询Mysql时返回字典结构的代码
- Python中的变量和作用域详解
- python中url解析 or url的base64编码
- [Python] Reuse Code in Multiple Projects with Python Modules
- Python之ffmpeg-python:ffmpeg-python库的简介、安装、使用方法之详细攻略
- Python:更改默认启动的python程序及其对应的安装包路径(更改pip的默认安装包的路径)图文教程之详细攻略
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(Menu的Command)
- Py之Matplotlib:python包之Matplotlib库图表绘制经验总结(中英文字体修改、横坐标文字进行横/纵向显示、控制坐标轴范围等)之详细攻略
- Python之ffmpeg-python:ffmpeg-python库的简介、安装、使用方法之详细攻略
- 已解决2.Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and wi
- 已解决2. Set PROTOCOL_BUPFERS_PYTHON_iMPLEMENTATION=python (but this will use pure-Python parsing and w
- Python编程:python面向对象
- Python爬虫:PyExecJS在python中运行javascript代码
- Python 设计模式之建造者模式 Builder Pattern
- Python:执行精确的浮点数运算
- Python将科学计数法数值转换为指定精度浮点数
- 终极PK | Python和Java哪个语言更有前途?
- python基础===jieba模块,Python 中文分词组件
- 多版本Python共存时pip给指定版本的python安装package的方法