pyqt5写一个抽奖程序(再次美化)

今天再次优化了之前用python写的抽奖程序
pyqt版本:pyqt5
python版本:3.6.6
下面直接上代码,有建议的话,欢迎大家交流评论!

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'Lucky_draw_pro.ui'
#
# Created by: PyQt5 UI code generator 5.15.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.
'''
1.3版本
1.bug的修改 get
2.实现动态图展示 get
3.程序图标展示 get
4.支持奖池表格导入+展示 get
5.中奖记录展示--初步确定用子窗口展示 notget
6.可配置抽奖人数和抽奖批次 支持新增、修改(删除暂时未实现) get
7.支持一次抽取多人 get
8.抽取方式优化:不采取随机数方式抽取,而是将名单乱序,使用数组切片方式进行截取,每次获取抽取人数,进行抽取。get

'''
# ''' font-family:设置字体
        #
        #     text-align:设置文本文字对齐方式
        #
        #     background:设置控件背景色
        #
        #     border:设置边界,none为无边界
        #
        #     font-size:字体大小
        #
        #     border-radius:设置四边圆角
        #
        #     hover:伪状态,设置鼠标悬浮在控件上方时变化
        # '''
import configparser

from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import (QMainWindow, QApplication,QLabel,QLineEdit,QMessageBox,QComboBox,QGridLayout,QTextBrowser)
from PyQt5.QtCore import Qt, QSize, QWaitCondition
from PyQt5.QtCore import Qt, QThread, pyqtSignal, QMutex
from PyQt5.QtGui import QMovie, QTextCursor, QIcon
import sys
import random
import numpy as np
import time
import xlrd
import re
import os

qmut_1 = QMutex() #创建线程锁
qmut_2 = QMutex()
BASE_DIR = os.path.dirname(os.path.abspath(__file__))

'''主界面'''
class Ui_Draw(object):
    #静态变量,使用静态变量直接被类获取,通过线程类调用修改截取大小
    contraler_count = 0
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.setWindowState(Qt.WindowMaximized)
        Dialog.setWindowTitle('Lucky')
        Dialog.setWindowIcon(QIcon('3738.png_300.png'))
        self.from_Dialog = Dialog
        self.gridLayout = QtWidgets.QGridLayout(Dialog)
        self.gridLayout.setObjectName("gridLayout")
        self.pushButton_2 = QtWidgets.QPushButton(Dialog)
        self.pushButton_2.setObjectName("pushButton_2")
        self.gridLayout.addWidget(self.pushButton_2, 5, 0, 1, 1)
        self.pushButton = QtWidgets.QPushButton(Dialog)
        self.pushButton.setObjectName("pushButton")
        self.gridLayout.addWidget(self.pushButton, 4, 0, 1, 1)
        self.pushButton_3 = QtWidgets.QPushButton(Dialog)
        self.pushButton_3.setObjectName("pushButton_3")
        self.gridLayout.addWidget(self.pushButton_3, 6, 0, 1, 1)
        self.pushButton_4 = QtWidgets.QPushButton(Dialog)
        self.pushButton_4.setObjectName("pushButton_4")
        self.gridLayout.addWidget(self.pushButton_4, 7, 0, 1, 1)
        self.gridLayout_3 = QtWidgets.QGridLayout()
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.textEdit_2 = QtWidgets.QTextEdit(Dialog)
        self.textEdit_2.setEnabled(True)
        self.textEdit_2.setObjectName("textEdit_2")
        self.gridLayout_3.addWidget(self.textEdit_2, 2, 0, 1, 1)
        self.textEdit = QtWidgets.QTextEdit(Dialog)
        self.textEdit.setEnabled(False)
        self.textEdit.setObjectName("textEdit")
        self.gridLayout_3.addWidget(self.textEdit, 0, 0, 1, 1)
        self.comboBox = QtWidgets.QComboBox(Dialog)
        self.comboBox.setObjectName("comboBox")
        self.gridLayout.addWidget(self.comboBox, 2, 0, 1, 1)
        self.spinBox = QtWidgets.QSpinBox(Dialog)
        self.spinBox.setObjectName("spinBox")
        self.gridLayout.addWidget(self.spinBox,3, 0, 1, 1)
        self.label = QtWidgets.QLabel(Dialog)
        self.label.setEnabled(False)
        self.label.setObjectName("label")
        #设置字体居中
        self.label.setAlignment(Qt.AlignCenter)
        self.gridLayout_3.addWidget(self.label, 1, 0, 1, 1)
        self.label.setStyleSheet('''QLabel{color:black;font-size:50px;font-family:webdings;}'''

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