Visual Studio Code -Python设置项

{
  // 设置 Python 解释器的路径。
  "python.pythonPath": "/path/to/python",

  // 启用或禁用自动格式化代码。
  "python.formatting.autopep8Enabled": true,

  // 自动格式化代码时使用的行宽度。
  "python.formatting.autopep8Args": ["--max-line-length=100"],

  // 启用或禁用自动排序导入语句。
  "python.sortImports.args": ["--force-single-line-imports"],

  // 在保存文件时自动排序导入语句。
  "python.sortImports.onSave": true,

  // 启用或禁用代码提示。
  "python.autoComplete.addBrackets": true,

  // 配置虚拟环境的查找方式。
  "python.venvPath": "${workspaceFolder}/venv",

  // 配置文档字符串的格式化方式。
  "python.format.docstringFormat": "google"
  
  // 设置 Python 解释器的路径。
  "python.pythonPath": "/path/to/python",

  // 启用或禁用自动格式化代码。
  "python.formatting.provider": "autopep8",
  "python.formatting.autopep8Args": ["--max-line-length=100"],

  // 在保存文件时自动格式化代码。
  "editor.formatOnSave": true,

  // 配置虚拟环境的查找方式。
  "python.venvPath": "${workspaceFolder}/venv",

  // 自动补全建议的触发字符。
  "editor.quickSuggestions": {
    "other": true,
    "comments": false,
    "strings": false
  },

  // 显示函数参数的提示信息。
  "python.hover.showParameters": true,

  // 配置运行和调试的 Python 环境。
  "python.pythonPath": "/path/to/python",
  "python.autoComplete.addBrackets": true,
  "python.envFile": "${workspaceFolder}/.env",

  // 控制是否显示导入错误。
  "python.analysis.diagnosticSeverityOverrides": {
    "reportImportCycles": "information",
    "reportUnusedImport": "warning"
  },

  // 启用或禁用 Jupyter Notebook 功能。
  "jupyter.enableCellCodeLens": true,
  "jupyter.alwaysTrustNotebooks": true,

  // 配置单元测试框架。
  "python.testing.unittestEnabled": true,
  "python.testing.pytestEnabled": false,

  // 控制运行测试时的覆盖率报告。
  "python.testing.coverageEnabled": true,
  "python.testing.coveragePath": ".coverage/",

  // 配置虚拟环境的查找方式。
  "python.venvFolders": ["envs", ".venv"],
  "python.autoComplete.addBrackets": true
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值