06 2020 档案
摘要:from PyQt5.QtWidgets import QApplication, QWidget import sys import pyqtgraph as pg import numpy as np class win(QWidget): def __init__(self): super()
阅读全文
摘要:import pyqtgraph as pg import numpy as np app = pg.QtGui.QApplication([]) pw = pg.PlotWidget(title="绘图") #创建一个绘图控件 pw.resize(600, 300) data = np.rando
阅读全文
摘要:import pyqtgraph as pg import numpy as np from pyqtgraph.Qt import QtCore app = pg.QtGui.QApplication([]) win = pg.GraphicsWindow(title="动态更新数据") win.
阅读全文
摘要:一、 Python可切片对象的索引方式 包括:正索引和负索引两部分,如下图所示,以list对象a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]为例: 二、 Python切片操作的一般方式 一个完整的切片表达式包含两个“:”,用于分隔三个参数(start_index、end_ind
阅读全文
摘要:import pyqtgraph as pg import numpy as np a = np.random.random(50) b = np.random.random(10) c = np.r_[a, b] app = pg.QtGui.QApplication([]) win = pg.G
阅读全文
摘要:用plot绘制图形 用addplot绘制图像 动态更新数据 用PlotWidget绘制图形 pyqtgraph嵌入到pyqt5中
阅读全文
摘要:文件拖拽: 实例一: import sys from PyQt5.QtWidgets import QApplication, QWidget, QLabel,QPushButton,QLineEdit,QFileDialog class DropLineEdit(QLineEdit): #重写QL
阅读全文
摘要:import pygame,time pygame.init() screen = pygame.display.set_mode((196, 100)) pygame.display.set_caption("pygame.mouse函数") pygame.mixer.music.load('酒醉
阅读全文
摘要:pygame.mouse函数 pygame.mouse.get_pressed() —— 获取鼠标按键的情况(是否被按下) import pygame pygame.init() screen = pygame.display.set_mode((196, 100)) pygame.display.
阅读全文
摘要:产品网站: https://www.yuque.com/makeblock-help-center-zh/laserbox/brief_introduction 使用前校准: http://cdnlab.makeblock.com/%E6%BF%80%E5%85%89%E5%AE%9D%E7%9B%
阅读全文
摘要:参考资料:https://eyehere.net/2011/python-pygame-novice-professional-9/ 向量原理实例: import math class Vector2(): def __init__(self, x=0.0, y=0.0): self.x = x s
阅读全文
摘要:资料:https://blog.csdn.net/qq_41556318/article/details/86304649 还有一个 mod 属性,用于描述组合键状态。 以下是组合键的常量定义: 温馨提示:如果 mod & KMOD_CTRL 是真的话,表示用户同时按下了 Ctrl 键
阅读全文
摘要:import pygame pygame.init() screen = pygame.display.set_mode((196, 60)) pygame.display.set_caption("pygame.key") pygame.event.set_grab(False) #是否独占所有的
阅读全文
摘要:import pygame pygame.init() screen = pygame.display.set_mode((96, 60)) pygame.display.set_caption("时间模块") t=pygame.time.get_ticks() #获取以毫秒为单位的时间 #返回自
阅读全文
摘要:import pygame pygame.init() screen = pygame.display.set_mode((960, 600)) background = pygame.image.load('2.jpg').convert_alpha() rect=pygame.Rect(10,1
阅读全文
摘要:计算机为数组分配一段连续的内存,从而支持对数组随机访问;由于项的地址在编号上是连续的,数组某一项的地址可以通过将两个值相加得出,即将数组的基本地址和项的偏移地址相加。数组的基本地址就是数组的第一项的机器地址。一个项的偏移地址就等于它的索引乘以数组的一个项所需要的内存单元数目的一个常量表示(在pyth
阅读全文
摘要:官网:http://www.pyqtgraph.org/ 安装:pip install pyqtgraph -i https://pypi.douban.com/simple import pyqtgraph as pg import numpy as np import sys a = np.ra
阅读全文
摘要:一个 Rect 对象可以由 left,top,width,height 几个值创建 Rect 对象覆盖的范围并不包含 right 和 bottom 指定的边缘位置 这样的话,如果一个 Rect 对象的 bottom 边框恰好是另一个 Rect 对象的 top 边框(即 rect1.bottom ==
阅读全文
摘要:Pygame 支持三种透明度类型:colorkeys,surface alphas 和 pixel alphas(温馨提示:colorkeys 是指设置图像中的某个颜色值为透明,surface alphas 是调整整个图像的透明度,pixel alphas 则是独立设置图像中每一个像素的透明度)。s
阅读全文
摘要:猫账号: 手机添加摄像头: 第一步:扫二维码下载APP 第二步:注册并登陆 第三步: 第四步: 扫描摄像头上的二维码,添加设备 第五步: 第六步: 电脑安装摄像头: 软件下载地址:https://service.mercurycom.com.cn/download-912.html 账号:我的手机
阅读全文
摘要:import pygame pygame.init() SCREEN_SIZE = (960, 600) screen = pygame.display.set_mode(SCREEN_SIZE,0) pygame.display.set_caption("字体") f=pygame.font.ge
阅读全文
摘要:pygame.display.list_modes() #返回本机所支持的窗口大小--列表 [(1920, 1080), (1680, 1050), (1600, 900), (1440, 900), (1400, 1050), (1366, 768), (1360, 768), (1280, 10
阅读全文
摘要:event = pygame.event.get() 返回当前全部事件队列并从队列中删除事件 不管当前有事件还是无事件,都会继续往下执行 可以指定需要获取的事件类型 返回值是列表 import pygame,time pygame.init() screen = pygame.display.set
阅读全文