python + PyQT5 制作了数位数字显示

python + PyQT5 制作了数位数字显示_第1张图片python + PyQT5 制作了数位数字显示_第2张图片

import sys
from PyQt5.QtWidgets import QMainWindow, QWidget, QLabel, QLineEdit, QApplication
from PyQt5.QtCore import Qt

# 数字与点位的对应
digits = {1: (3, 7), 2: (2, 3, 4, 5, 6), 3: (2, 3, 4, 6, 7), 4: (1, 3, 4, 7), 5: (1, 2, 4, 6, 7), 6: (1, 2, 4, 5, 6, 7),
          7: (2, 3, 7), 8: (1, 2, 3, 4, 5, 6, 7), 9: (1, 2, 3, 4, 6, 7), 0: (1, 2, 3, 5, 6, 7)}

# 数字点位的类,含有on和off功能
class light(QLabel):
    def __init__(self, form):
        super().__init__(form)
        self.setUI()

    de

你可能感兴趣的:(PY,python,pyqt)