Python 基础 - 备忘

运行 Python 代码

python filename.py

注意一定要带 python ,Linux 环境下可能是 python3

更换 PIP 源

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

更新 PIP

python -m pip install --upgrade pip

安装 pytest

python -m pip install --user pytest

运行 pytest

在 Terminal 中输入 pytest

如果在执行命令 pytest 时没有制定任何参数,pytest 将运行它在当前目录中找到的所有测试。要测试指定文件,使用 pytest test_filename.py

安装 pygame

python -m pip install --user pygame

在pygame 界面中,如果要检测按键,需确保输入法为英文,否则即使程序正确也会出现按键无效的现象。

相关推荐
朝朝辞暮i14 小时前
C++ 第 23 课:class —— 开始真正进入面向对象
开发语言·c++·算法
言乐615 小时前
HTML视频审核模型
python·django·virtualenv·pygame·tornado
小师兄吃牛肉15 小时前
C语言篇:宏
c语言·开发语言
郑同学的笔记15 小时前
【c++随笔28】strcmp 和 memcmp对比
开发语言·c++
言乐615 小时前
Python根据无法识别搜索词找出可能输入内容模型
开发语言·python·django·virtualenv·pygame
weixin_3077791316 小时前
有限产能智能排产与动态重排智能体:从需求解构到技术实现
开发语言·人工智能·算法·架构
kakakahahahaha16 小时前
Windows C盘临时文件清理:%temp%、Windows Temp、Prefetch、Windows.old与hiberfil.sys处理指南
c语言·开发语言·windows
朝朝辞暮i16 小时前
C++ 第 27 课:智能指针 shared_ptr
开发语言·c++·算法
yl453016 小时前
硫酸泄露处理生产商怎么选才够专业
大数据·人工智能·python
朝朝辞暮i16 小时前
C++ 第 29 课:回调函数 Callback
开发语言·c++·算法