{"id":61017,"date":"2026-01-16T21:05:58","date_gmt":"2026-01-16T13:05:58","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/61017.html"},"modified":"2026-01-16T21:05:58","modified_gmt":"2026-01-16T13:05:58","slug":"pyqt%e6%a1%8c%e9%9d%a2%e7%a5%9e%e5%99%a8q-generator-pro%ef%bc%9a%e4%b8%80%e9%94%ae%e6%89%b9%e9%87%8f%e7%94%9f%e6%88%90%e5%86%85%e5%ae%b9%e5%90%8d%e7%a7%b0%e8%87%aa%e5%ae%9a%e4%b9%89%e4%ba%8c%e7%bb%b4","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/61017.html","title":{"rendered":"PyQt\u684c\u9762\u795e\u5668Q-Generator Pro\uff1a\u4e00\u952e\u6279\u91cf\u751f\u6210\u5185\u5bb9\u540d\u79f0\u81ea\u5b9a\u4e49\u4e8c\u7ef4\u7801"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E4%B8%80%E3%80%81%E5%BC%95%E8%A8%80-toc\" style=\"margin-left:0px\">\u4e00\u3001\u5f15\u8a00<\/p>\n<p id=\"%E4%BA%8C%E3%80%81GUI%E7%95%8C%E9%9D%A2%E8%AE%BE%E8%AE%A1-toc\" style=\"margin-left:0px\">\u4e8c\u3001GUI\u754c\u9762\u8bbe\u8ba1<\/p>\n<p id=\"1.%E7%AC%AC%E4%B8%80%E6%AD%A5%EF%BC%9A%E5%8D%95%E5%87%BB%E4%B8%8B%E8%BD%BD%E6%A8%A1%E6%9D%BF-toc\" style=\"margin-left:40px\">1.\u7b2c\u4e00\u6b65&#xff1a;\u5355\u51fb\u4e0b\u8f7d\u6a21\u677f<\/p>\n<p id=\"2.%E7%AC%AC%E4%BA%8C%E6%AD%A5%EF%BC%9A%E5%8D%95%E5%87%BB%E4%B8%8A%E4%BC%A0%E6%A8%A1%E6%9D%BF-toc\" style=\"margin-left:40px\">2.\u7b2c\u4e8c\u6b65&#xff1a;\u5355\u51fb\u4e0a\u4f20\u6a21\u677f<\/p>\n<p id=\"3.%E7%AC%AC%E4%B8%89%E6%AD%A5%EF%BC%9A%E5%BC%80%E5%A7%8B%E6%89%B9%E9%87%8F%E7%94%9F%E6%88%90-toc\" style=\"margin-left:40px\">3.\u7b2c\u4e09\u6b65&#xff1a;\u5f00\u59cb\u6279\u91cf\u751f\u6210<\/p>\n<p id=\"4.%E5%BC%82%E5%B8%B8%E6%8F%90%E7%A4%BA-toc\" style=\"margin-left:40px\">4.\u5f02\u5e38\u63d0\u793a<\/p>\n<p id=\"5.%E7%95%8C%E9%9D%A2%E8%AE%BE%E8%AE%A1jiemian.py-toc\" style=\"margin-left:40px\">5.\u754c\u9762\u8bbe\u8ba1jiemian.py<\/p>\n<p id=\"%E4%B8%89%E3%80%81%E4%B8%BB%E8%A6%81%E7%A8%8B%E5%BA%8F%E8%AF%A6%E8%A7%A3-toc\" style=\"margin-left:0px\">\u4e09\u3001\u4e3b\u8981\u7a0b\u5e8f\u8be6\u89e3<\/p>\n<p id=\"1.%E5%AF%BC%E5%85%A5%E6%89%80%E9%9C%80%E6%A8%A1%E5%9D%97-toc\" style=\"margin-left:40px\">1.\u5bfc\u5165\u6240\u9700\u6a21\u5757<\/p>\n<p id=\"2.%E5%88%9D%E5%A7%8B%E5%8C%96%E8%AE%BE%E7%BD%AE-toc\" style=\"margin-left:40px\">2.\u521d\u59cb\u5316\u8bbe\u7f6e<\/p>\n<p id=\"3.%E6%A8%A1%E6%9D%BF%E6%96%87%E4%BB%B6%E7%9A%84%E7%94%9F%E6%88%90%E4%B8%8E%E4%B8%8B%E8%BD%BD-toc\" style=\"margin-left:40px\">3.\u6a21\u677f\u6587\u4ef6\u7684\u751f\u6210\u4e0e\u4e0b\u8f7d<\/p>\n<p id=\"4.%E9%80%89%E6%8B%A9%E5%B9%B6%E4%B8%8A%E4%BC%A0%E6%A8%A1%E6%9D%BF%E6%96%87%E4%BB%B6-toc\" style=\"margin-left:40px\">4.\u9009\u62e9\u5e76\u4e0a\u4f20\u6a21\u677f\u6587\u4ef6<\/p>\n<p id=\"5.%E8%AF%BB%E5%8F%96%E6%A8%A1%E6%9D%BF%E6%96%87%E4%BB%B6%E5%B9%B6%E6%89%B9%E9%87%8F%E7%94%9F%E6%88%90-toc\" style=\"margin-left:40px\">5.\u8bfb\u53d6\u6a21\u677f\u6587\u4ef6\u5e76\u6279\u91cf\u751f\u6210<\/p>\n<p id=\"6.%E8%87%AA%E5%AE%9A%E4%B9%89%E5%87%BD%E6%95%B0-toc\" style=\"margin-left:40px\">6.\u81ea\u5b9a\u4e49\u51fd\u6570<\/p>\n<p id=\"%E5%9B%9B%E3%80%81%E6%80%BB%E7%A8%8B%E5%BA%8F%E4%BB%A3%E7%A0%81QRCode.py-toc\" style=\"margin-left:0px\">\u56db\u3001\u603b\u7a0b\u5e8f\u4ee3\u7801QRCode.py<\/p>\n<hr id=\"hr-toc\" \/>\n<h2 id=\"%E4%B8%80%E3%80%81%E5%BC%95%E8%A8%80\">\u4e00\u3001\u5f15\u8a00<\/h2>\n<p><span style=\"color:#fe2c24\">&#xff08;\u597d\u4e45\u4e0d\u89c1&#xff01;\u4ece\u4ee5\u4e0b\u8fd9\u7bc7\u6587\u7ae0\u5f00\u59cb&#xff0c;\u6b63\u5f0f\u5ba3\u544a\u56de\u5f52&#xff01;&#xff09;<\/span><\/p>\n<p style=\"text-align:justify\">\u5728\u4f7f\u7528\u4e4b\u524d\u6240\u505a\u7684\u4e8c\u7ef4\u7801\u751f\u6210\u5668\u65f6&#xff08;<span style=\"background-color:#a2e043\">\u53c2\u8003Python&#043;PyQt&#xff1a;30\u884c\u4ee3\u7801\u5b9e\u73b0\u4e8c\u7ef4\u7801\u81ea\u7531\u6216TabWidget\u96c6\u6210&#xff1a;Pyqt\u6253\u9020\u4e8c\u7ef4\u7801\u5de5\u4f5c\u53f0<\/span>&#xff09;&#xff0c;\u53d1\u73b0<span style=\"color:#fe2c24\">\u4e00\u6b21\u53ea\u80fd\u4ea7\u751f\u4e00\u4e2a\u4e8c\u7ef4\u7801<\/span>\u3002\u4f46\u5728\u73b0\u5b9e\u751f\u6d3b\u4e2d&#xff0c;\u9700\u8981<span style=\"color:#fe2c24\">\u4e00\u6b21\u6027\u4ea7\u751f\u5927\u91cf\u7684\u6307\u5b9a\u5185\u5bb9\u7684\u4e8c\u7ef4\u7801<\/span>&#xff0c;\u800c\u4e14\u9700\u8981\u4f7f\u4ea7\u751f\u7684\u6240\u6709<span style=\"color:#fe2c24\">\u4e8c\u7ef4\u7801\u6587\u4ef6\u6613\u4e8e\u533a\u5206<\/span>\u3002\u82e5\u8fdb\u884c\u624b\u52a8\u590d\u5236\u7c98\u8d34\u3001\u9010\u4e2a\u547d\u540d\u3001\u53cd\u590d\u4fdd\u5b58\u7684\u91cd\u590d\u52b3\u52a8&#xff0c;\u65e9\u5df2\u4e0d\u662f\u6548\u7387\u95ee\u9898&#xff0c;\u800c\u662f\u5bf9\u521b\u9020\u529b\u7684\u65e0\u58f0\u6d88\u8017\u3002\u56e0\u6b64\u6211\u4e0d\u518d\u6ee1\u8db3\u4e8e\u5728\u7ebf\u5de5\u5177\u7684\u4e91\u7aef\u4f9d\u8d56\u4e0e\u6570\u636e\u6cc4\u9732\u98ce\u9669&#xff0c;\u4e5f\u4e0d\u613f\u88ab\u201cqrcode_001.png\u201d\u8fd9\u6837\u6beb\u65e0\u610f\u4e49\u7684\u6587\u4ef6\u540d\u56f0\u4f4f\u5f52\u6863\u903b\u8f91\u3002\u4e8e\u662f&#xff0c;\u57fa\u4e8e Python \u4e0e PyQt \u6784\u5efa\u7684\u8fd9\u6b3e\u672c\u5730\u5316\u751f\u6210\u5668\u5e94\u8fd0\u800c\u751f\u2014\u2014<span style=\"background-color:#a2e043\">\u5b83\u4e0d\u4f9d\u8d56\u7f51\u7edc&#xff0c;\u4e0d\u4e0a\u4f20\u6570\u636e&#xff0c;\u53ea\u9700\u4e0a\u4f20\u4e00\u4efdexcel\u6587\u4ef6&#xff0c;\u5c31\u80fd\u5728\u6570\u79d2\u5185\u5c06\u5343\u6761\u4fe1\u606f\u8f6c\u5316\u4e3a\u9ad8\u6e05\u4e8c\u7ef4\u7801&#xff0c;\u5e76\u6309\u4f60\u8bbe\u5b9a\u7684\u89c4\u5219\u2014\u2014\u5982\u201c\u8ba2\u5355\u53f7_\u65e5\u671f_\u5e8f\u5217\u201d\u6216\u201c\u4ea7\u54c1\u7f16\u7801_V2\u201d\u2014\u2014\u81ea\u52a8\u8d4b\u4e88\u6bcf\u5f20\u56fe\u7247\u72ec\u4e00\u65e0\u4e8c\u7684\u201c\u8eab\u4efd\u201d\u3002<\/span>\u5b83\u4e0d\u662f\u811a\u672c\u7684\u5806\u780c&#xff0c;\u800c\u662f\u4e00\u5957\u5d4c\u5165\u4f60\u5de5\u4f5c\u6d41\u7684\u81ea\u52a8\u5316\u5f15\u64ce&#xff0c;\u8ba9\u4fe1\u606f\u7684\u751f\u6210\u4ece\u673a\u68b0\u64cd\u4f5c&#xff0c;\u56de\u5f52\u4e3a\u6709\u903b\u8f91\u3001\u6709\u5c0a\u4e25\u7684\u6d41\u7a0b\u8bbe\u8ba1\u3002<\/p>\n<p><span style=\"background-color:#ffd900\">\u4e0d\u518d\u53ea\u662f\u751f\u6210\u4e8c\u7ef4\u7801&#xff0c;\u800c\u662f\u5728\u6784\u5efa\u5c5e\u4e8e\u81ea\u5df1\u7684\u6570\u5b57\u8d44\u4ea7\u7ba1\u7406\u4f53\u7cfb\u3002<\/span><\/p>\n<h2 id=\"%E4%BA%8C%E3%80%81GUI%E7%95%8C%E9%9D%A2%E8%AE%BE%E8%AE%A1\">\u4e8c\u3001GUI\u754c\u9762\u8bbe\u8ba1<\/h2>\n<p>\u4f7f\u7528PyQt5\u8fdb\u884c\u754c\u9762\u7684\u642d\u5efa&#xff0c;\u6700\u7ec8\u754c\u9762\u5982\u4e0b&#xff1a;<\/p>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"250\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130554-696a37b20761b.png\" width=\"256\" \/><\/p>\n<h3 id=\"1.%E7%AC%AC%E4%B8%80%E6%AD%A5%EF%BC%9A%E5%8D%95%E5%87%BB%E4%B8%8B%E8%BD%BD%E6%A8%A1%E6%9D%BF\">1.\u7b2c\u4e00\u6b65&#xff1a;\u5355\u51fb\u4e0b\u8f7d\u6a21\u677f<\/h3>\n<\/p>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"251\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130554-696a37b2235eb.png\" width=\"258\" \/>\u00a0<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"249\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130554-696a37b238ac7.png\" width=\"256\" \/><\/p>\n<p>\u76f4\u63a5\u5355\u51fb\u4e0b\u8f7d\u5373\u53ef&#xff0c;\u4e0b\u8f7d\u7684excel\u6587\u4ef6\u6a21\u677f\u5982\u4e0b\u3002<\/p>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"120\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130554-696a37b24e175.png\" width=\"552\" \/><\/p>\n<h3 id=\"2.%E7%AC%AC%E4%BA%8C%E6%AD%A5%EF%BC%9A%E5%8D%95%E5%87%BB%E4%B8%8A%E4%BC%A0%E6%A8%A1%E6%9D%BF\">2.\u7b2c\u4e8c\u6b65&#xff1a;\u5355\u51fb\u4e0a\u4f20\u6a21\u677f<\/h3>\n<p>\u5c06\u5bf9\u5e94\u4fe1\u606f\u586b\u5199\u81f3\u6a21\u677fexcel\u6587\u4ef6\u540e&#xff0c;\u5355\u51fb\u4e0a\u4f20\u6a21\u677f&#xff0c;\u5f39\u51fa\u201c\u4e0a\u4f20\u6210\u529f\u201d\u7684\u63d0\u793a\u6846\u3002<\/p>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"253\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130554-696a37b29c054.png\" width=\"260\" \/>\u00a0<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"254\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130554-696a37b2b1682.png\" width=\"261\" \/><\/p>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"264\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130554-696a37b2c6e46.png\" width=\"531\" \/><\/p>\n<p>\u586b\u5199\u793a\u4f8b\u4fe1\u606f\u5982\u4e0b&#xff1a;<\/p>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"144\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130555-696a37b3eaf2e.png\" width=\"525\" \/><\/p>\n<h3 id=\"3.%E7%AC%AC%E4%B8%89%E6%AD%A5%EF%BC%9A%E5%BC%80%E5%A7%8B%E6%89%B9%E9%87%8F%E7%94%9F%E6%88%90\">3.\u7b2c\u4e09\u6b65&#xff1a;\u5f00\u59cb\u6279\u91cf\u751f\u6210<\/h3>\n<p style=\"text-align:justify\">\u70b9\u51fb\u201c\u5f00\u59cb\u6279\u91cf\u751f\u6210\u201d&#xff0c;\u5373\u53ef\u6839\u636e\u6a21\u677fexcel\u6587\u4ef6\u6240\u586b\u5199\u5185\u5bb9\u751f\u6210\u5177\u6709\u76f8\u5e94\u5185\u5bb9\u7684\u4e8c\u7ef4\u7801&#xff0c;\u5e76\u4ee5\u6a21\u677fexcel\u6587\u4ef6\u4e2d\u7b2c\u4e00\u5217\u6570\u636e\u8fdb\u884c\u76f8\u5e94\u547d\u540d\u3002\u6700\u7ec8\u7ed3\u679c\u4fdd\u5b58\u5728\u672c\u5730\u201cresult\u201d\u6587\u4ef6\u5939\u4e2d\u3002<\/p>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"237\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130556-696a37b44d343.png\" width=\"243\" \/>\u00a0<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"234\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130556-696a37b471649.png\" width=\"284\" \/><\/p>\n<p style=\"text-align:justify\"><span style=\"color:#fe2c24\">\u6279\u91cf\u751f\u6210\u7684\u4e8c\u7ef4\u7801\u5982\u4e0b\u6240\u793a&#xff0c;\u6bcf\u4e2a\u4e8c\u7ef4\u7801\u6240\u8868\u793a\u7684\u5185\u5bb9\u5747\u4e0e\u6a21\u677fexcel\u6587\u4ef6\u76f8\u5bf9\u5e94&#xff0c;\u4e14\u6587\u4ef6\u540d\u79f0\u4e5f\u6839\u636e\u6240\u586b\u201c\u4e8c\u7ef4\u7801\u6587\u4ef6\u540d\u79f0\u201d\u91cd\u547d\u540d\u5b8c\u6bd5\u3002<\/span><\/p>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"342\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130556-696a37b48a961.png\" width=\"1882\" \/><\/p>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"332\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130556-696a37b4ed9e6.png\" width=\"1360\" \/><\/p>\n<p>\u626b\u7801\u6548\u679c\u5982\u4e0b&#xff1a;<\/p>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"210\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130557-696a37b524f6b.jpg\" width=\"409\" \/><\/p>\n<\/p>\n<h3 id=\"4.%E5%BC%82%E5%B8%B8%E6%8F%90%E7%A4%BA\">4.\u5f02\u5e38\u63d0\u793a<\/h3>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"208\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130557-696a37b5762b8.png\" width=\"213\" \/>\u00a0<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"207\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130557-696a37b58e0a7.png\" width=\"213\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"207\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130557-696a37b5a3ce2.png\" width=\"212\" \/><\/p>\n<h3 id=\"5.%E7%95%8C%E9%9D%A2%E8%AE%BE%E8%AE%A1jiemian.py\">5.\u754c\u9762\u8bbe\u8ba1jiemian.py<\/h3>\n<p>\u6700\u540e\u9644\u4e0a\u901a\u8fc7pyuic5\u4ea7\u751f\u7684GUI\u754c\u9762\u4ee3\u7801jiemian.py&#xff1a;<\/p>\n<p># -*- coding: utf-8 -*-<\/p>\n<p># Form implementation generated from reading ui file &#039;jiemian.ui&#039;<br \/>\n#<br \/>\n# Created by: PyQt5 UI code generator 5.15.11<br \/>\n#<br \/>\n# WARNING: Any manual changes made to this file will be lost when pyuic5 is<br \/>\n# run again.  Do not edit this file unless you know what you are doing.<\/p>\n<p>from PyQt5 import QtCore, QtGui, QtWidgets<\/p>\n<p>class Ui_Form(object):<br \/>\n    def setupUi(self, Form):<br \/>\n        Form.setObjectName(&#034;Form&#034;)<br \/>\n        Form.setEnabled(True)<br \/>\n        Form.resize(300, 270)<br \/>\n        Form.setMinimumSize(QtCore.QSize(300, 270))<br \/>\n        Form.setMaximumSize(QtCore.QSize(300, 270))<br \/>\n        icon &#061; QtGui.QIcon()<br \/>\n        icon.addPixmap(QtGui.QPixmap(&#034;:\/image1.png&#034;), QtGui.QIcon.Normal, QtGui.QIcon.Off)<br \/>\n        Form.setWindowIcon(icon)<br \/>\n        self.label_5 &#061; QtWidgets.QLabel(Form)<br \/>\n        self.label_5.setGeometry(QtCore.QRect(130, 70, 141, 31))<br \/>\n        font &#061; QtGui.QFont()<br \/>\n        font.setFamily(&#034;Adobe Arabic&#034;)<br \/>\n        font.setPointSize(16)<br \/>\n        self.label_5.setFont(font)<br \/>\n        self.label_5.setObjectName(&#034;label_5&#034;)<br \/>\n        self.label_8 &#061; QtWidgets.QLabel(Form)<br \/>\n        self.label_8.setGeometry(QtCore.QRect(40, 20, 271, 31))<br \/>\n        font &#061; QtGui.QFont()<br \/>\n        font.setFamily(&#034;Adobe Arabic&#034;)<br \/>\n        font.setPointSize(18)<br \/>\n        font.setBold(False)<br \/>\n        font.setWeight(50)<br \/>\n        self.label_8.setFont(font)<br \/>\n        self.label_8.setObjectName(&#034;label_8&#034;)<br \/>\n        self.label_10 &#061; QtWidgets.QLabel(Form)<br \/>\n        self.label_10.setGeometry(QtCore.QRect(210, 60, 71, 51))<br \/>\n        self.label_10.setText(&#034;&#034;)<br \/>\n        self.label_10.setPixmap(QtGui.QPixmap(&#034;:\/image1.png&#034;))<br \/>\n        self.label_10.setObjectName(&#034;label_10&#034;)<br \/>\n        self.pushButton &#061; QtWidgets.QPushButton(Form)<br \/>\n        self.pushButton.setGeometry(QtCore.QRect(40, 150, 211, 23))<br \/>\n        self.pushButton.setObjectName(&#034;pushButton&#034;)<br \/>\n        self.pushButton_2 &#061; QtWidgets.QPushButton(Form)<br \/>\n        self.pushButton_2.setGeometry(QtCore.QRect(40, 230, 211, 23))<br \/>\n        self.pushButton_2.setObjectName(&#034;pushButton_2&#034;)<br \/>\n        self.pushButton_3 &#061; QtWidgets.QPushButton(Form)<br \/>\n        self.pushButton_3.setGeometry(QtCore.QRect(40, 190, 211, 23))<br \/>\n        self.pushButton_3.setObjectName(&#034;pushButton_3&#034;)<\/p>\n<p>        self.retranslateUi(Form)<br \/>\n        QtCore.QMetaObject.connectSlotsByName(Form)<\/p>\n<p>    def retranslateUi(self, Form):<br \/>\n        _translate &#061; QtCore.QCoreApplication.translate<br \/>\n        Form.setWindowTitle(_translate(&#034;Form&#034;, &#034;Batch_Producting&#034;))<br \/>\n        self.label_5.setText(_translate(&#034;Form&#034;, &#034;Designed By&#034;))<br \/>\n        self.label_8.setText(_translate(&#034;Form&#034;, &#034;\u4e8c\u7ef4\u7801\u6279\u91cf\u5feb\u901f\u751f\u6210&#034;))<br \/>\n        self.pushButton.setText(_translate(&#034;Form&#034;, &#034;\u5355\u51fb\u4e0b\u8f7d\u6a21\u677f&#034;))<br \/>\n        self.pushButton_2.setText(_translate(&#034;Form&#034;, &#034;\u5f00\u59cb\u6279\u91cf\u751f\u6210&#034;))<br \/>\n        self.pushButton_3.setText(_translate(&#034;Form&#034;, &#034;\u5355\u51fb\u4e0a\u4f20\u6a21\u677f&#034;))<br \/>\nimport ziyuan_rc<\/p>\n<h2 id=\"%E4%B8%89%E3%80%81%E4%B8%BB%E8%A6%81%E7%A8%8B%E5%BA%8F%E8%AF%A6%E8%A7%A3\">\u4e09\u3001\u4e3b\u8981\u7a0b\u5e8f\u8be6\u89e3<\/h2>\n<h3 id=\"1.%E5%AF%BC%E5%85%A5%E6%89%80%E9%9C%80%E6%A8%A1%E5%9D%97\">1.\u5bfc\u5165\u6240\u9700\u6a21\u5757<\/h3>\n<p>import sys, os<br \/>\nimport qrcode<br \/>\nfrom jiemian import *<br \/>\nfrom PyQt5.QtWidgets import QApplication, QWidget<br \/>\nfrom openpyxl import Workbook<br \/>\nimport pandas as pd<br \/>\n# \u4fdd\u6301\u7a97\u53e3\u5927\u5c0f\u548cqtdesigner\u4e2d\u7684\u4e00\u81f4<br \/>\nfrom PyQt5 import QtCore<br \/>\nQtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling) <\/p>\n<p style=\"text-align:justify\"><span style=\"color:#fe2c24\">\u4e8c\u7ef4\u7801<\/span>\u6700\u5e38\u7528\u4e14\u6743\u5a01\u7684\u8868\u8fbe\u662f\u201c<span style=\"color:#fe2c24\">QR Code<\/span>\u201d&#xff08;\u5168\u79f0<span style=\"color:#fe2c24\">Quick Response Code<\/span>&#xff09;&#xff0c;\u5176\u4e2d\u201cQR\u201d\u4ee3\u8868\u201cQuick Response\u201d&#xff08;\u5feb\u901f\u54cd\u5e94&#xff09;&#xff0c;\u4f53\u73b0\u5176<span style=\"color:#333333\"><span style=\"background-color:#a2e043\">\u9ad8\u901f\u8bc6\u8bfb\u7279\u6027\u200c<\/span><span style=\"background-color:#a2e043\">\u3002<\/span><span style=\"background-color:#a2e043\">\u5728\u5bfc\u5165qrcode\u4e4b\u524d&#xff0c;\u9700\u8981\u901a\u8fc7pip\u6307\u4ee4\u5b89\u88c5qrcode\u3002<\/span><\/span><\/p>\n<p>pip install qrcode <\/p>\n<p>\u4e0d\u61c2\u4e3a\u5565\u9700\u8981\u5bfc\u5165Qtcore\u7684&#xff0c;\u8bf7\u770b\u4e00\u952e\u66dd\u5149&#xff1a;Python&#043;PyQt\u5b9e\u73b0\u7684\u6587\u4ef6\u76ee\u5f55\u900f\u89c6\u955c\u3002<\/p>\n<h3 id=\"2.%E5%88%9D%E5%A7%8B%E5%8C%96%E8%AE%BE%E7%BD%AE\">2.\u521d\u59cb\u5316\u8bbe\u7f6e<\/h3>\n<p>    def __init__(self):<br \/>\n        super(QWidget, self).__init__()<br \/>\n        self.setupUi(self)<\/p>\n<p>        self.pushButton.clicked.connect(self.xiazai)<br \/>\n        self.pushButton_2.clicked.connect(self.duqu)<br \/>\n        self.pushButton_3.clicked.connect(self.upload)<\/p>\n<p>        self.upload_flag &#061; False <\/p>\n<p style=\"text-align:justify\">\u7ee7\u627f\u4e8e\u7236\u7c7bQWidget&#xff0c;\u5e76\u663e\u793a\u4e3b\u754c\u9762&#xff1b;\u5c06pushbutton\u3001pushbutton_2\u3001pushbutton_3\u5206\u522b\u7ed1\u5b9a\u4e8exiazai\u3001duqu\u3001upload&#xff1b;\u8bbe\u7acb\u4e0a\u4f20\u6807\u5fd7\u4f4dupload_flag\u8868\u793a\u7528\u6237\u662f\u5426\u4e0a\u4f20\u6a21\u677fexcel\u6587\u4ef6\u3002<\/p>\n<h3 id=\"3.%E6%A8%A1%E6%9D%BF%E6%96%87%E4%BB%B6%E7%9A%84%E7%94%9F%E6%88%90%E4%B8%8E%E4%B8%8B%E8%BD%BD\">3.\u6a21\u677f\u6587\u4ef6\u7684\u751f\u6210\u4e0e\u4e0b\u8f7d<\/h3>\n<p>    def xiazai(self):<br \/>\n        # \u4e0b\u8f7d\u5bf9\u5e94\u8868\u6a21\u677f\u6587\u4ef6<br \/>\n        wb &#061; Workbook()<br \/>\n        ws &#061; wb.active<br \/>\n        ws.column_dimensions[&#039;A&#039;].width &#061; 36<br \/>\n        ws.column_dimensions[&#039;B&#039;].width &#061; 36<br \/>\n        ws.cell(row&#061;1, column&#061;1, value&#061;&#034;\u4e8c\u7ef4\u7801\u6587\u4ef6\u540d\u79f0&#034;)<br \/>\n        ws.cell(row&#061;1, column&#061;2, value&#061;&#034;\u4e8c\u7ef4\u7801\u5b58\u653e\u5185\u5bb9&#034;)<br \/>\n        wb.save(&#039;\u6a21\u677f.xlsx&#039;)<br \/>\n        QtWidgets.QMessageBox.information(self,&#034;\u4e0b\u8f7d&#034;,&#034;\u5bf9\u5e94\u8868\u6a21\u677f\u6587\u4ef6\u4e0b\u8f7d\u6210\u529f&#xff0c;\u8bf7\u67e5\u770b\u5f53\u524d\u76ee\u5f55&#xff01;&#034;) <\/p>\n<p style=\"text-align:justify\">\u4f7f\u7528openpyxl\u5e93\u751f\u6210\u6a21\u677f\u6587\u4ef6&#xff0c;\u8bbe\u7f6eA\u3001B\u5217\u7684\u5217\u5bbd\u5206\u522b\u4e3a36&#xff1b;A\u3001B\u5217\u7684\u8868\u5934\u4e5f\u540c\u7406\u8fdb\u884c\u7b80\u5355\u8bbe\u7f6e&#xff1b;\u6700\u540e\u5c06\u6587\u4ef6\u4fdd\u5b58\u5230\u5f53\u524d\u76ee\u5f55\u4e0b&#xff0c;\u6587\u4ef6\u540d\u79f0\u547d\u540d\u4e3a\u201c\u6a21\u677f.xlsx\u201d&#xff1b;\u5e76\u63d0\u793a\u7528\u6237\u76f8\u5173\u6210\u529f\u4fe1\u606f\u3002<\/p>\n<h3 id=\"4.%E9%80%89%E6%8B%A9%E5%B9%B6%E4%B8%8A%E4%BC%A0%E6%A8%A1%E6%9D%BF%E6%96%87%E4%BB%B6\">4.\u9009\u62e9\u5e76\u4e0a\u4f20\u6a21\u677f\u6587\u4ef6<\/h3>\n<p>    def upload(self):<br \/>\n        self.excel_data &#061; shangchuan()<br \/>\n        self.upload_flag &#061; True<br \/>\n        # print(self.excel_data) <\/p>\n<p>\u8c03\u7528\u81ea\u5b9a\u4e49\u51fd\u6570shangchuan\u5b9e\u73b0\u7528\u6237\u9009\u62e9\u6587\u4ef6\u5e76\u4e0a\u4f20\u7684\u529f\u80fd&#xff0c;\u518d\u6b21\u5e76\u8bbe\u7f6e\u6807\u5fd7\u4f4d\u72b6\u6001\u4e3aTrue\u3002<\/p>\n<h3 id=\"5.%E8%AF%BB%E5%8F%96%E6%A8%A1%E6%9D%BF%E6%96%87%E4%BB%B6%E5%B9%B6%E6%89%B9%E9%87%8F%E7%94%9F%E6%88%90\">5.\u8bfb\u53d6\u6a21\u677f\u6587\u4ef6\u5e76\u6279\u91cf\u751f\u6210<\/h3>\n<p>    def duqu(self):<br \/>\n        if self.upload_flag &#061;&#061; True:<br \/>\n            name_lst &#061; list(self.excel_data[&#039;\u4e8c\u7ef4\u7801\u6587\u4ef6\u540d\u79f0&#039;])<br \/>\n            content_lst &#061; list(self.excel_data[&#039;\u4e8c\u7ef4\u7801\u5b58\u653e\u5185\u5bb9&#039;])<\/p>\n<p>            img_file &#061; &#034;result&#034;<br \/>\n            # \u5b9a\u4e49\u4fdd\u5b58\u7ed3\u679c\u7684\u6587\u4ef6\u5939\u540d\u79f0\u4e3a\u201cresult\u201d<br \/>\n            if not os.path.exists(img_file): # \u68c0\u67e5\u6587\u4ef6\u5939\u662f\u5426\u5b58\u5728&#xff0c;\u5426\u5219\u521b\u5efa<br \/>\n                os.makedirs(img_file)<\/p>\n<p>            for i in range(len(name_lst)):<br \/>\n                img_product &#061; shengcheng(str(content_lst[i]))<\/p>\n<p>                img_product.save(img_file&#043;&#034;\\\\\\\\&#034;&#043;name_lst[i]&#043;&#039;.jpg&#039;) #<\/p>\n<p>            QtWidgets.QMessageBox.information(self, &#034;\u6210\u529f&#034;, &#034;\u4e8c\u7ef4\u7801\u4fdd\u5b58\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u7684result\u6587\u4ef6\u5939\u4e2d&#xff0c;\u8bf7\u67e5\u770b&#xff01;&#034;)<br \/>\n        else:<br \/>\n            QtWidgets.QMessageBox.critical(self, &#034;\u63d0\u793a&#034;, &#034;\u8bf7\u4e0a\u4f20\u6a21\u677f\u6587\u4ef6&#xff01;&#034;) <\/p>\n<p style=\"text-align:justify\">\u4ee5\u6807\u5fd7\u4f4dupload_flag\u7684\u72b6\u6001\u4e3a\u4f9d\u636e\u5224\u65ad\u7528\u6237\u662f\u5426\u4e0a\u4f20\u7b26\u5408\u8981\u6c42\u7684\u6a21\u677fexcel\u6587\u4ef6&#xff0c;\u5e76\u8bfb\u53d6\u6570\u636e\u5206\u522b\u5b58\u50a8\u5728\u5217\u8868name_list\u548ccontent_list\u4e2d&#xff0c;<span style=\"background-color:#a2e043\">\u524d\u8005\u7528\u4e8e\u91cd\u547d\u540d\u6587\u4ef6&#xff0c;\u540e\u8005\u7528\u4e8e\u5199\u5165\u4e8c\u7ef4\u7801<\/span>&#xff1b;\u65b0\u5efa\u6587\u4ef6\u5939\u201cresult\u201d&#xff0c;\u7528\u4e8e\u5b58\u50a8\u6279\u91cf\u751f\u6210\u7684\u5168\u90e8\u4e8c\u7ef4\u7801\u7167\u7247&#xff1b;\u6700\u540e&#xff0c;<span style=\"background-color:#a2e043\">\u901a\u8fc7\u5faa\u73af&#xff0c;\u8c03\u7528\u81ea\u5b9a\u4e49\u51fd\u6570shengcheng&#xff0c;\u8fd4\u56de\u751f\u6210\u7684\u6bcf\u4e00\u5f20\u4e8c\u7ef4\u7801\u7167\u7247&#xff0c;\u547d\u540d\u540e\u5b58\u50a8<\/span>\u3002<\/p>\n<h3 id=\"6.%E8%87%AA%E5%AE%9A%E4%B9%89%E5%87%BD%E6%95%B0\">6.\u81ea\u5b9a\u4e49\u51fd\u6570<\/h3>\n<p>def shengcheng(content):<br \/>\n    # \u521b\u5efa\u4e8c\u7ef4\u7801\u914d\u7f6e\u5bf9\u8c61<br \/>\n    qr &#061; qrcode.QRCode(version&#061;3, box_size&#061;8, border&#061;4)<br \/>\n    # version&#061;3&#xff1a;\u4e8c\u7ef4\u7801\u5c3a\u5bf8\u7248\u672c (1-40)&#xff0c;3\u5bf9\u5e9429&#215;29\u6a21\u5757&#xff08;\u81ea\u52a8\u9002\u914d\u65f6\u53ef\u7701\u7565&#xff09;<br \/>\n    # box_size&#061;8&#xff1a;\u6bcf\u4e2a\u4e8c\u7ef4\u7801\u5c0f\u65b9\u5757\u53608\u50cf\u7d20<br \/>\n    # border&#061;4&#xff1a;\u4e8c\u7ef4\u7801\u8fb9\u7f18\u7559\u767d\u5bbd\u5ea6&#xff08;4\u4e2a\u5c0f\u65b9\u5757\u5bbd\u5ea6\u7684\u767d\u8272\u8fb9\u6846&#xff09;<\/p>\n<p>    if content !&#061; &#034;&#034;:<br \/>\n        qr.add_data(content) # \u6dfb\u52a0\u6570\u636e<br \/>\n        # \u751f\u6210\u6570\u636e\u77e9\u9635<br \/>\n        qr.make(fit&#061;True) # fit&#061;True&#xff1a;\u81ea\u52a8\u9009\u62e9\u6700\u5c0f\u53ef\u7528\u7248\u672c\u5c3a\u5bf8&#xff1b;\u82e5\u6570\u636e\u8fc7\u957f\u4f1a\u81ea\u52a8\u5347\u7ea7 version \u503c&#xff08;\u8986\u76d6\u521d\u59cb\u8bbe\u7f6e\u7684version&#061;3&#xff09;<br \/>\n        image &#061; qr.make_image(fill&#061;&#039;Black&#039;) # \u6e32\u67d3\u56fe\u50cf<\/p>\n<p>        return image <\/p>\n<p>\u901a\u8fc7\u8f93\u5165\u53c2\u6570&#xff1a;content&#xff0c;\u6765\u8fd4\u56de\u751f\u6210\u7684\u4e8c\u7ef4\u7801\u56fe\u7247image\u3002<\/p>\n<p>def shangchuan():<br \/>\n    filepath, _ &#061; QtWidgets.QFileDialog.getOpenFileName(None, &#034;\u8bf7\u9009\u62e9\u6587\u4ef6&#034;, &#034;&#034;, &#034;XLSX\u5de5\u4f5c\u8868 (*.xlsx)&#034;)  # \u83b7\u53d6\u6587\u4ef6\u8def\u5f84<br \/>\n    if filepath:<br \/>\n        # \u83b7\u53d6\u539f\u59cbdf<br \/>\n        yuanshi_df &#061; pd.read_excel(filepath)<br \/>\n        if not yuanshi_df.empty:<br \/>\n            QtWidgets.QMessageBox.information(None, &#034;\u6210\u529f&#034;, &#034;\u4e0a\u4f20\u6210\u529f&#xff01;&#034;)<br \/>\n            return yuanshi_df<br \/>\n        else:<br \/>\n            QtWidgets.QMessageBox.critical(None, &#034;\u63d0\u793a&#034;, &#034;\u8bf7\u68c0\u67e5\u64cd\u4f5c\u6b65\u9aa4\u6216\u4e0a\u4f20\u975e\u7a7a\u6587\u4ef6&#xff01;&#034;)<br \/>\n            shangchuan() # \u76f4\u5230\u4e0a\u4f20\u975e\u7a7a\u6587\u4ef6<br \/>\n    else:<br \/>\n        QtWidgets.QMessageBox.critical(None, &#034;\u63d0\u793a&#034;, &#034;\u8bf7\u9009\u62e9XLSX\u5de5\u4f5c\u8868\u7c7b\u578b&#xff01;&#034;)<br \/>\n        shangchuan() # \u76f4\u5230\u6210\u529f\u9009\u62e9\u7c7b\u578b\u5e76\u4e0a\u4f20 <\/p>\n<p>\u4f7f\u7528\u6237\u4e00\u76f4\u4e0a\u4f20&#xff0c;\u9664\u975e\u4e0a\u4f20\u4e86\u5de5\u4f5c\u8868\u7c7b\u578b&#xff0c;\u4e14\u6587\u4ef6\u975e\u7a7a\u3002<\/p>\n<h2 id=\"%E5%9B%9B%E3%80%81%E6%80%BB%E7%A8%8B%E5%BA%8F%E4%BB%A3%E7%A0%81QRCode.py\">\u56db\u3001\u603b\u7a0b\u5e8f\u4ee3\u7801QRCode.py<\/h2>\n<p>import sys, os<br \/>\nimport qrcode<br \/>\nfrom jiemian import *<br \/>\nfrom PyQt5.QtWidgets import QApplication, QWidget<br \/>\nfrom openpyxl import Workbook<br \/>\nimport pandas as pd<br \/>\n# \u4fdd\u6301\u7a97\u53e3\u5927\u5c0f\u548cqtdesigner\u4e2d\u7684\u4e00\u81f4<br \/>\nfrom PyQt5 import QtCore<br \/>\nQtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)<\/p>\n<p>class mainwindow(QWidget, Ui_Form):<br \/>\n    def __init__(self):<br \/>\n        super(QWidget, self).__init__()<br \/>\n        self.setupUi(self)<\/p>\n<p>        self.pushButton.clicked.connect(self.xiazai)<br \/>\n        self.pushButton_2.clicked.connect(self.duqu)<br \/>\n        self.pushButton_3.clicked.connect(self.upload)<\/p>\n<p>        self.upload_flag &#061; False<\/p>\n<p>    def xiazai(self):<br \/>\n        # \u4e0b\u8f7d\u5bf9\u5e94\u8868\u6a21\u677f\u6587\u4ef6<br \/>\n        wb &#061; Workbook()<br \/>\n        ws &#061; wb.active<br \/>\n        ws.column_dimensions[&#039;A&#039;].width &#061; 36<br \/>\n        ws.column_dimensions[&#039;B&#039;].width &#061; 36<br \/>\n        ws.cell(row&#061;1, column&#061;1, value&#061;&#034;\u4e8c\u7ef4\u7801\u6587\u4ef6\u540d\u79f0&#034;)<br \/>\n        ws.cell(row&#061;1, column&#061;2, value&#061;&#034;\u4e8c\u7ef4\u7801\u5b58\u653e\u5185\u5bb9&#034;)<br \/>\n        wb.save(&#039;\u6a21\u677f.xlsx&#039;)<br \/>\n        QtWidgets.QMessageBox.information(self,&#034;\u4e0b\u8f7d&#034;,&#034;\u5bf9\u5e94\u8868\u6a21\u677f\u6587\u4ef6\u4e0b\u8f7d\u6210\u529f&#xff0c;\u8bf7\u67e5\u770b\u5f53\u524d\u76ee\u5f55&#xff01;&#034;)<\/p>\n<p>    def upload(self):<br \/>\n        self.excel_data &#061; shangchuan()<br \/>\n        self.upload_flag &#061; True<br \/>\n        # print(self.excel_data)<\/p>\n<p>    def duqu(self):<br \/>\n        if self.upload_flag &#061;&#061; True:<br \/>\n            name_lst &#061; list(self.excel_data[&#039;\u4e8c\u7ef4\u7801\u6587\u4ef6\u540d\u79f0&#039;])<br \/>\n            content_lst &#061; list(self.excel_data[&#039;\u4e8c\u7ef4\u7801\u5b58\u653e\u5185\u5bb9&#039;])<\/p>\n<p>            img_file &#061; &#034;result&#034;<br \/>\n            # \u5b9a\u4e49\u4fdd\u5b58\u7ed3\u679c\u7684\u6587\u4ef6\u5939\u540d\u79f0\u4e3a\u201cresult\u201d<br \/>\n            if not os.path.exists(img_file): # \u68c0\u67e5\u6587\u4ef6\u5939\u662f\u5426\u5b58\u5728&#xff0c;\u5426\u5219\u521b\u5efa<br \/>\n                os.makedirs(img_file)<\/p>\n<p>            for i in range(len(name_lst)):<br \/>\n                img_product &#061; shengcheng(str(content_lst[i]))<\/p>\n<p>                img_product.save(img_file&#043;&#034;\\\\\\\\&#034;&#043;name_lst[i]&#043;&#039;.jpg&#039;) #<\/p>\n<p>            QtWidgets.QMessageBox.information(self, &#034;\u6210\u529f&#034;, &#034;\u4e8c\u7ef4\u7801\u4fdd\u5b58\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u7684result\u6587\u4ef6\u5939\u4e2d&#xff0c;\u8bf7\u67e5\u770b&#xff01;&#034;)<br \/>\n        else:<br \/>\n            QtWidgets.QMessageBox.critical(self, &#034;\u63d0\u793a&#034;, &#034;\u8bf7\u4e0a\u4f20\u6a21\u677f\u6587\u4ef6&#xff01;&#034;)<\/p>\n<p>def shengcheng(content):<br \/>\n    # \u521b\u5efa\u4e8c\u7ef4\u7801\u914d\u7f6e\u5bf9\u8c61<br \/>\n    qr &#061; qrcode.QRCode(version&#061;3, box_size&#061;8, border&#061;4)<br \/>\n    # version&#061;3&#xff1a;\u4e8c\u7ef4\u7801\u5c3a\u5bf8\u7248\u672c (1-40)&#xff0c;3\u5bf9\u5e9429&#215;29\u6a21\u5757&#xff08;\u81ea\u52a8\u9002\u914d\u65f6\u53ef\u7701\u7565&#xff09;<br \/>\n    # box_size&#061;8&#xff1a;\u6bcf\u4e2a\u4e8c\u7ef4\u7801\u5c0f\u65b9\u5757\u53608\u50cf\u7d20<br \/>\n    # border&#061;4&#xff1a;\u4e8c\u7ef4\u7801\u8fb9\u7f18\u7559\u767d\u5bbd\u5ea6&#xff08;4\u4e2a\u5c0f\u65b9\u5757\u5bbd\u5ea6\u7684\u767d\u8272\u8fb9\u6846&#xff09;<\/p>\n<p>    if content !&#061; &#034;&#034;:<br \/>\n        qr.add_data(content) # \u6dfb\u52a0\u6570\u636e<br \/>\n        # \u751f\u6210\u6570\u636e\u77e9\u9635<br \/>\n        qr.make(fit&#061;True) # fit&#061;True&#xff1a;\u81ea\u52a8\u9009\u62e9\u6700\u5c0f\u53ef\u7528\u7248\u672c\u5c3a\u5bf8&#xff1b;\u82e5\u6570\u636e\u8fc7\u957f\u4f1a\u81ea\u52a8\u5347\u7ea7 version \u503c&#xff08;\u8986\u76d6\u521d\u59cb\u8bbe\u7f6e\u7684version&#061;3&#xff09;<br \/>\n        image &#061; qr.make_image(fill&#061;&#039;Black&#039;) # \u6e32\u67d3\u56fe\u50cf<\/p>\n<p>        return image<\/p>\n<p>def shangchuan():<br \/>\n    filepath, _ &#061; QtWidgets.QFileDialog.getOpenFileName(None, &#034;\u8bf7\u9009\u62e9\u6587\u4ef6&#034;, &#034;&#034;, &#034;XLSX\u5de5\u4f5c\u8868 (*.xlsx)&#034;)  # \u83b7\u53d6\u6587\u4ef6\u8def\u5f84<br \/>\n    if filepath:<br \/>\n        # \u83b7\u53d6\u539f\u59cbdf<br \/>\n        yuanshi_df &#061; pd.read_excel(filepath)<br \/>\n        if not yuanshi_df.empty:<br \/>\n            QtWidgets.QMessageBox.information(None, &#034;\u6210\u529f&#034;, &#034;\u4e0a\u4f20\u6210\u529f&#xff01;&#034;)<br \/>\n            return yuanshi_df<br \/>\n        else:<br \/>\n            QtWidgets.QMessageBox.critical(None, &#034;\u63d0\u793a&#034;, &#034;\u8bf7\u68c0\u67e5\u64cd\u4f5c\u6b65\u9aa4\u6216\u4e0a\u4f20\u975e\u7a7a\u6587\u4ef6&#xff01;&#034;)<br \/>\n            shangchuan() # \u76f4\u5230\u4e0a\u4f20\u975e\u7a7a\u6587\u4ef6<br \/>\n    else:<br \/>\n        QtWidgets.QMessageBox.critical(None, &#034;\u63d0\u793a&#034;, &#034;\u8bf7\u9009\u62e9XLSX\u5de5\u4f5c\u8868\u7c7b\u578b&#xff01;&#034;)<br \/>\n        shangchuan() # \u76f4\u5230\u6210\u529f\u9009\u62e9\u7c7b\u578b\u5e76\u4e0a\u4f20<\/p>\n<p>if __name__ &#061;&#061; &#039;__main__&#039;:<br \/>\n    app &#061; QApplication(sys.argv)<br \/>\n    w &#061; mainwindow()<br \/>\n    w.show()<br \/>\n    sys.exit(app.exec_()) <\/p>\n<p><span style=\"color:#fe2c24\">\u6b22\u8fce\u7559\u8a00\/\u79c1\u4fe1\u6c9f\u901a\u4ea4\u6d41&#xff01;<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u5f55<br \/>\n\u4e00\u3001\u5f15\u8a00<br \/>\n\u4e8c\u3001GUI\u754c\u9762\u8bbe\u8ba1<br \/>\n1.\u7b2c\u4e00\u6b65&#xff1a;\u5355\u51fb\u4e0b\u8f7d\u6a21\u677f<br \/>\n2.\u7b2c\u4e8c\u6b65&#xff1a;\u5355\u51fb\u4e0a\u4f20\u6a21\u677f<br \/>\n3.\u7b2c\u4e09\u6b65&#xff1a;\u5f00\u59cb\u6279\u91cf\u751f\u6210<br \/>\n4.\u5f02\u5e38\u63d0\u793a<br \/>\n5.\u754c\u9762\u8bbe\u8ba1jiemian.py<br \/>\n\u4e09\u3001\u4e3b\u8981\u7a0b\u5e8f\u8be6\u89e3<br \/>\n1.\u5bfc\u5165\u6240\u9700\u6a21\u5757<br \/>\n2.\u521d\u59cb\u5316\u8bbe\u7f6e<br \/>\n3.\u6a21\u677f\u6587\u4ef6\u7684\u751f\u6210\u4e0e\u4e0b\u8f7d<br \/>\n4.\u9009\u62e9\u5e76\u4e0a\u4f20\u6a21\u677f\u6587\u4ef6<br \/>\n5.\u8bfb\u53d6\u6a21\u677f\u6587\u4ef6\u5e76\u6279\u91cf\u751f\u6210<br \/>\n6.\u81ea\u5b9a\u4e49\u51fd\u6570<br \/>\n\u56db\u3001\u603b\u7a0b\u5e8f\u4ee3\u7801QRCode.py \u4e00\u3001\u5f15\u8a00<br \/>\n&#xff08;\u597d\u4e45\u4e0d\u89c1&#xff01;\u4ece\u4ee5\u4e0b\u8fd9\u7bc7\u6587\u7ae0<\/p>\n","protected":false},"author":2,"featured_media":61001,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[6441,1705,81,1666,556,395],"topic":[],"class_list":["post-61017","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-6441","tag-pyqt","tag-python","tag-1666","tag-556","tag-395"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PyQt\u684c\u9762\u795e\u5668Q-Generator Pro\uff1a\u4e00\u952e\u6279\u91cf\u751f\u6210\u5185\u5bb9\u540d\u79f0\u81ea\u5b9a\u4e49\u4e8c\u7ef4\u7801 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/61017.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PyQt\u684c\u9762\u795e\u5668Q-Generator Pro\uff1a\u4e00\u952e\u6279\u91cf\u751f\u6210\u5185\u5bb9\u540d\u79f0\u81ea\u5b9a\u4e49\u4e8c\u7ef4\u7801 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u76ee\u5f55 \u4e00\u3001\u5f15\u8a00 \u4e8c\u3001GUI\u754c\u9762\u8bbe\u8ba1 1.\u7b2c\u4e00\u6b65&#xff1a;\u5355\u51fb\u4e0b\u8f7d\u6a21\u677f 2.\u7b2c\u4e8c\u6b65&#xff1a;\u5355\u51fb\u4e0a\u4f20\u6a21\u677f 3.\u7b2c\u4e09\u6b65&#xff1a;\u5f00\u59cb\u6279\u91cf\u751f\u6210 4.\u5f02\u5e38\u63d0\u793a 5.\u754c\u9762\u8bbe\u8ba1jiemian.py \u4e09\u3001\u4e3b\u8981\u7a0b\u5e8f\u8be6\u89e3 1.\u5bfc\u5165\u6240\u9700\u6a21\u5757 2.\u521d\u59cb\u5316\u8bbe\u7f6e 3.\u6a21\u677f\u6587\u4ef6\u7684\u751f\u6210\u4e0e\u4e0b\u8f7d 4.\u9009\u62e9\u5e76\u4e0a\u4f20\u6a21\u677f\u6587\u4ef6 5.\u8bfb\u53d6\u6a21\u677f\u6587\u4ef6\u5e76\u6279\u91cf\u751f\u6210 6.\u81ea\u5b9a\u4e49\u51fd\u6570 \u56db\u3001\u603b\u7a0b\u5e8f\u4ee3\u7801QRCode.py \u4e00\u3001\u5f15\u8a00 &#xff08;\u597d\u4e45\u4e0d\u89c1&#xff01;\u4ece\u4ee5\u4e0b\u8fd9\u7bc7\u6587\u7ae0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/61017.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-16T13:05:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130554-696a37b20761b.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/61017.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/61017.html\",\"name\":\"PyQt\u684c\u9762\u795e\u5668Q-Generator Pro\uff1a\u4e00\u952e\u6279\u91cf\u751f\u6210\u5185\u5bb9\u540d\u79f0\u81ea\u5b9a\u4e49\u4e8c\u7ef4\u7801 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-16T13:05:58+00:00\",\"dateModified\":\"2026-01-16T13:05:58+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/61017.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/61017.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/61017.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PyQt\u684c\u9762\u795e\u5668Q-Generator Pro\uff1a\u4e00\u952e\u6279\u91cf\u751f\u6210\u5185\u5bb9\u540d\u79f0\u81ea\u5b9a\u4e49\u4e8c\u7ef4\u7801\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PyQt\u684c\u9762\u795e\u5668Q-Generator Pro\uff1a\u4e00\u952e\u6279\u91cf\u751f\u6210\u5185\u5bb9\u540d\u79f0\u81ea\u5b9a\u4e49\u4e8c\u7ef4\u7801 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/61017.html","og_locale":"zh_CN","og_type":"article","og_title":"PyQt\u684c\u9762\u795e\u5668Q-Generator Pro\uff1a\u4e00\u952e\u6279\u91cf\u751f\u6210\u5185\u5bb9\u540d\u79f0\u81ea\u5b9a\u4e49\u4e8c\u7ef4\u7801 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u76ee\u5f55 \u4e00\u3001\u5f15\u8a00 \u4e8c\u3001GUI\u754c\u9762\u8bbe\u8ba1 1.\u7b2c\u4e00\u6b65&#xff1a;\u5355\u51fb\u4e0b\u8f7d\u6a21\u677f 2.\u7b2c\u4e8c\u6b65&#xff1a;\u5355\u51fb\u4e0a\u4f20\u6a21\u677f 3.\u7b2c\u4e09\u6b65&#xff1a;\u5f00\u59cb\u6279\u91cf\u751f\u6210 4.\u5f02\u5e38\u63d0\u793a 5.\u754c\u9762\u8bbe\u8ba1jiemian.py \u4e09\u3001\u4e3b\u8981\u7a0b\u5e8f\u8be6\u89e3 1.\u5bfc\u5165\u6240\u9700\u6a21\u5757 2.\u521d\u59cb\u5316\u8bbe\u7f6e 3.\u6a21\u677f\u6587\u4ef6\u7684\u751f\u6210\u4e0e\u4e0b\u8f7d 4.\u9009\u62e9\u5e76\u4e0a\u4f20\u6a21\u677f\u6587\u4ef6 5.\u8bfb\u53d6\u6a21\u677f\u6587\u4ef6\u5e76\u6279\u91cf\u751f\u6210 6.\u81ea\u5b9a\u4e49\u51fd\u6570 \u56db\u3001\u603b\u7a0b\u5e8f\u4ee3\u7801QRCode.py \u4e00\u3001\u5f15\u8a00 &#xff08;\u597d\u4e45\u4e0d\u89c1&#xff01;\u4ece\u4ee5\u4e0b\u8fd9\u7bc7\u6587\u7ae0","og_url":"https:\/\/www.wsisp.com\/helps\/61017.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-16T13:05:58+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116130554-696a37b20761b.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/61017.html","url":"https:\/\/www.wsisp.com\/helps\/61017.html","name":"PyQt\u684c\u9762\u795e\u5668Q-Generator Pro\uff1a\u4e00\u952e\u6279\u91cf\u751f\u6210\u5185\u5bb9\u540d\u79f0\u81ea\u5b9a\u4e49\u4e8c\u7ef4\u7801 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-16T13:05:58+00:00","dateModified":"2026-01-16T13:05:58+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/61017.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/61017.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/61017.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"PyQt\u684c\u9762\u795e\u5668Q-Generator Pro\uff1a\u4e00\u952e\u6279\u91cf\u751f\u6210\u5185\u5bb9\u540d\u79f0\u81ea\u5b9a\u4e49\u4e8c\u7ef4\u7801"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/61017","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=61017"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/61017\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/61001"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=61017"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=61017"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=61017"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=61017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}