IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 开发工具 -> Visual Studio Code的几个问题 -> 正文阅读

[开发工具]Visual Studio Code的几个问题

小结

最近在使用Visual Studio Code的时候,碰到几个问题:安装linting,添加额外的环境路径PYTHONPATH,ANACONDA,以及调试等等,进行了解决。

问题和解决

Linting Python in Visual Studio Code

Linging可以对Python语言错误进行检查,参考Linting Python in Visual Studio Code 进行安装使用。

Visual Studio Code代码浏览

参考How can I navigate back to the last cursor position in Visual Studio Code?
Alt + ← … navigate back 也就是ALT + 左箭头后退

Alt + → … navigate forward也就是ALT + 右箭头前进

pyc进行反编译

下载Easy Python Decompiler 这个软件可以对pyc进行反编译。

添加额外的PYTHONPATH环境路径

参考Stackoverflow: Visual Studio Code - How to add multiple paths to python path?
Using Python environments in VS Code

CTRL + SHIFT + P进入命令行再进入Python: Select Interpreter可以选择运行环境

CTRL + SHIFT + D进入调试设置,创建launch.json和settings.json

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: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": true,
            "env": { "PYTHONPATH": "C:\\ProgramData\\Anaconda2:C:\\ProgramData\\Anaconda2\\Lib:C:\\ProgramData\\Anaconda2\\DLLs:C:\\ProgramData\\Anaconda2\\Lib\\lib-tk" }
        }
    ]
}

settings.json内容如下:

{
    "python.testing.pytestArgs": [
        "."
    ],
    "python.testing.unittestEnabled": false,
    "python.testing.pytestEnabled": true,
    "python.analysis.extraPaths": [
        "C:\\Program Files (x86)\\LibSE\\Python27",
        "C:\\Program Files (x86)\\LibSE"
    ]
}

以上python.analysis.extraPaths是额外的环境路径。

安装ANACONDA

参考Fix: ‘conda’ is not recognized as an internal or external command, operable program or batch file
https://repo.anaconda.com/archive/
对ANACONDA进行安装

参考

Linting Python in Visual Studio Code
How can I navigate back to the last cursor position in Visual Studio Code?
Easy Python Decompiler
Stackoverflow: Visual Studio Code - How to add multiple paths to python path?
Using Python environments in VS Code
How to add to the PYTHONPATH in Windows, so it finds my modules/packages?
Fix: ‘conda’ is not recognized as an internal or external command, operable program or batch file
https://repo.anaconda.com/archive/
Python debugging in VS Code

  开发工具 最新文章
Postman接口测试之Mock快速入门
ASCII码空格替换查表_最全ASCII码对照表0-2
如何使用 ssh 建立 socks 代理
Typora配合PicGo阿里云图床配置
SoapUI、Jmeter、Postman三种接口测试工具的
github用相对路径显示图片_GitHub 中 readm
Windows编译g2o及其g2o viewer
解决jupyter notebook无法连接/ jupyter连接
Git恢复到之前版本
VScode常用快捷键
上一篇文章      下一篇文章      查看所有文章
加:2022-09-15 02:12:56  更:2022-09-15 02:14:04 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年5日历 -2024/5/18 8:27:24-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码