Getting Started with Python in VS Code
在VS Code使用Python
官方教程:https://code.visualstudio.com/docs/python/python-tutorial
Start VS Code in a project (workspace) folder
mkdir hello
cd hello
code .
创建文件夹,在文件夹中打开终端,输入code .
也可以运行VS Code, **File > Open Folder ** 选择项目文件夹
Select a Python interpreter
使用快捷键 Ctrl+Shift+P 打开 Command Palette ,输入 Python: Select Interpreter,选择相应的python解释器。
或者在VS Code左下角Select Python Environment 进行选择
Install and use packages
Python开发人员中的最佳实践是避免将软件包安装到全局解释器环境中。 相反,您使用的是特定于项目的虚拟环境,其中包含全局解释器的副本。 激活该环境后,您随后安装的所有软件包都将与其他环境隔离。 这种隔离减