首先,Ubuntu是默认安装python环境的;
其次,要运行XXX.py文件的话,就像调用shell脚本一样:./[路径]/XXX.py;
如果脚本中用到USB的话,必须安装pyusb,如:sudo apt-get install python-usb。
与QT相结合:
二、运行时错误:
1、IndentationError: unexpected indent tab和空格格式上的错误
三、技术博客汇总:
1、python中获取打包成执行文件(exe)和脚本运行文件的路径
使用Pygame
Pygame有很多的模块,下面是一张一览表:
模块名 功能
pygame.cdrom 访问光驱
pygame.cursors 加载光标
pygame.display 访问显示设备
pygame.draw 绘制形状、线和点
pygame.event 管理事件
pygame.font 使用字体
pygame.image 加载和存储图片
pygame.joystick 使用游戏手柄或者 类似的东西
pygame.key 读取键盘按键
pygame.mixer 声音
pygame.mouse 鼠标
pygame.movie 播放视频
pygame.music 播放音频
pygame.overlay 访问高级视频叠加
pygame 就是我们在学的这个东西了……
pygame.rect 管理矩形区域
pygame.sndarray 操作声音数据
pygame.sprite 操作移动图像
pygame.surface 管理图像和屏幕
pygame.surfarray 管理点阵图像数据
pygame.time 管理时间和帧信息
pygame.transform 缩放和移动图像
相关参考: