惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
Martin Fowler
Martin Fowler
N
Netflix TechBlog - Medium
WordPress大学
WordPress大学
罗磊的独立博客
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
A
About on SuperTechFans
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
D
Docker
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
Blog — PlanetScale
Blog — PlanetScale
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
I
InfoQ
J
Java Code Geeks
博客园 - 聂微东
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
美团技术团队
小众软件
小众软件
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog

博客园 - Hopesun

宝庆(含新化)菜 一个贴布产品(虎标镇痛贴布-RD(温感型)),新加坡企业生产 小初高中教材电子版本(PDF)下载地址 视频生成(开源框架、商业化产品) 股票软件及指标公式学习网站 anaconda 中安装的包用Pip升级高版本的方法 钉钉组件的属性分类设置 冬季皮肤干燥,洗澡用沐浴油、沐浴露 强力漱囗液~西吡氯铵含漱液 Qlib 学习资料收集1 DeepWiki vs. Zread 对决,AI 代码文档解析 有限免费使用的 AI 大模型,收集。 获取 AKshare 的数据,为 VectorBt、Pybroker等框架提供数据 Anaconda 安装后,手动安装 JupyterNotebook、JupyterLab python 安装目录、运行环境、venv与包管理、PyCharm配置、Anaconda 配置等相关内容 VectorBT Backtrader Zipline 比较 回测 —Zipline 已死?还是只需重启 Zipline-Reloaded? Backtesting – Is Zipline Dead? Or does it just need a reload? 时间序列预测与股票分析框架 prophet、NeuralProphet、FinRL等 Python可视化开发工具,类似VB、Delphi Hyper3d rodin AccuRIG AI 创作 3D Poly Haven 高质量 3D 资源的网站 PhET模拟实验----仿真程序(初等教育) https://jiucai.fun/ 一个人网站
Vscode 开发 Python 的一些基础设置
Hopesun · 2025-04-10 · via 博客园 - Hopesun

1、单独安装 不同版本的 Python 解释器,或  Anaconda;

2、安装 VSCode,及中文、相关Python 开发的插件;

      重点有: (1)虚拟环境配置插件

3、配置 settings.json ,这个文件主要配置  编辑器、文件等相关的(工作空间 WorkSpace、即项目文件夹)设置项。

      用户(User)设置项 是VSCode 全局性的。示例如下

{

    "python-envs.defaultEnvManager": "ms-python.python:system",

    "python-envs.pythonProjects": [],

    "editor.fontSize": 18,                                 ------  改变编辑器字体大小

    "editor.formatOnSave": true,

    "editor.formatOnPaste": true

}

4、运行与调试 配置:launch.json 以便在运行和调试代码时提供特定的参数和配置。 这个比较麻烦。 参考官方文档:Python debugging in VS Code

    点击侧边栏的“运行和调试”图标,有 一个 “创建 launch.json 文件” 的连接按钮,可以生成配置文件 launch.json。  示例如下,保障能用!

    它定义了调试器如何启动和运行程序,最重要的就是四块内容:文件路径、传入参数、虚拟环境、工作路径

      {

    "version": "0.2.0",             ----- 版本,非必需

    "configurations": [

        {

            "name": "Python Debugger: Python File 主文件",                     ------  名称 ,好像没有很大影响,你看着办

            "type": "debugpy",                                                                       ------  新的变化 debugpy,以前是:python 

            "request": "launch",                                                                     ------  有两个选择:设置为 "launch" 以启动程序,或者 "attach" 以附加到已运行的进程。

          "program": "${file}",                                                      ------  要调试的 Python 脚本的路径。你可以使用 ${file} 来指定当前打开的文件,

                                                                                                                             或者指定具体文件的路径。例如,"program": "${workspaceFolder}/script.py"

            

             或 "module": "xxxbb"                                                                    ------  要调试的 Python 模块的路径。 program 与 module,二选一。

            "console": "integratedTerminal",                                                ------  指定调试器使用的控制台类型。例如,"integratedTerminal" 是使用 VSCode 的集成终端。

            "args": [                                                                                         ------  为程序传递的命令行参数。例如,"args": ["arg1", "arg2"], "args": "${command:pickArgs}"。  

                "arg1",

                "arg2"

            ],

            "env": {                                                                                          -----  设置环境变量。例如,"env": {"VAR1": "value1"}。

                "VAR1": "value1"

            },

            "cwd": "${workspaceFolder}"                                                     -----  设置工作目录。例如,"cwd": "${workspaceFolder}"

        }

    ]

}

VSCode 中的  Predefined variables  :The following predefined variables are supported:

VariableDescription
${userHome} Path of the user's home folder
${workspaceFolder} Path of the folder opened in VS Code
${workspaceFolderBasename} Name of the folder opened in VS Code without any slashes (/)
${file} Currently opened file
${fileWorkspaceFolder} Currently opened file's workspace folder
${relativeFile} Currently opened file relative to workspaceFolder
${relativeFileDirname} Currently opened file's dirname relative to workspaceFolder
${fileBasename} Currently opened file's basename
${fileBasenameNoExtension} Currently opened file's basename with no file extension
${fileExtname} Currently opened file's extension
${fileDirname} Currently opened file's folder path
${fileDirnameBasename} Currently opened file's folder name
${cwd} Task runner's current working directory upon the startup of VS Code
${lineNumber} Currently selected line number in the active file
${columnNumber} Currently selected column number in the active file
${selectedText} Currently selected text in the active file
${execPath} Path to the running VS Code executable
${defaultBuildTask} Name of the default build task
${pathSeparator} Character used by the operating system to separate components in file paths
${/} Shorthand for ${pathSeparator}

Environment variables  :You can reference environment variables with the ${env:Name} syntax. For example, ${env:USERNAME} references the USERNAME environment variable.

{
  "type": "node",
  "request": "launch",
  "name": "Launch Program",
  "program": "${workspaceFolder}/app.js",
  "cwd": "${workspaceFolder}",
  "args": ["${env:USERNAME}"]
}