Python3 基础学习进展是根据python3 菜鸟教程步骤进行的。
确保你已经安装了Python 3.8或更高版本。你可以从Python官方网站下载并安装。
1.创建虚拟环境
cd Python3-Root
python -m venv .venv2.激活虚拟环境
# Windows:
.venv\Scripts\activate
# macOS/Linux:
source .venv/bin/activate3.安装Python依赖
cd example
pip install -r requirements.txt
# or
pip install package-name4.简单示例
创建文件:main.py
# This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
def print_hi(name):
# Use a breakpoint in the code line below to debug your script.
print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint.
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
print_hi('PyCharm')