今天要复现的是python随机选人程序
要求:需要带qt界面,点击执行后,能够在电脑上显示那些人被选中
本次设计采用pyqt进行设计
安装方法:
pyqt5与flask安装
1.python代码界面设计源码
注意将文件保存为untitled.py,其他的也可以,但在驱动程序调用时需要注意import的这个文件的名字
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'untitled.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.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(639, 188)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.pushButton = QtWidgets.QPushButton(self.centralwidget)
self.pushButton.setGeometry(QtCore.QRect(100, 30, 75, 23))
self.pushButton.setObjectName("pushButton")
self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setGeometry(

本文介绍了一个使用Python和PyQt实现的随机选人程序,程序带有GUI界面,点击执行后能在屏幕上显示选中的人。程序设计采用PyQt进行,详细步骤包括安装PyQt5和Flask,编写代码界面设计源码,实现驱动逻辑,以及如何将代码打包成可执行的exe文件。

5784

被折叠的 条评论
为什么被折叠?



