Guest User

scrape_ui.py

a guest
Dec 27th, 2022
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.93 KB | None | 0 0
  1. from PyQt5 import QtCore, QtGui, QtWidgets
  2.  
  3. class Ui_MainWindow(object):
  4. def setupUi(self, MainWindow):
  5. MainWindow.setObjectName("MainWindow")
  6. MainWindow.resize(490, 500)
  7. self.centralwidget = QtWidgets.QWidget(MainWindow)
  8. self.centralwidget.setObjectName("centralwidget")
  9. self.tell_keyword = QtWidgets.QLabel(self.centralwidget)
  10. self.tell_keyword.setGeometry(QtCore.QRect(30, 20, 167, 26))
  11. self.tell_keyword.setMaximumSize(QtCore.QSize(191, 16777215))
  12. font = QtGui.QFont()
  13. font.setFamily("Taipei Sans TC Beta")
  14. font.setPointSize(14)
  15. font.setBold(False)
  16. font.setWeight(50)
  17. self.tell_keyword.setFont(font)
  18. self.tell_keyword.setObjectName("tell_keyword")
  19. self.tell_pages = QtWidgets.QLabel(self.centralwidget)
  20. self.tell_pages.setGeometry(QtCore.QRect(30, 90, 148, 26))
  21. self.tell_pages.setMaximumSize(QtCore.QSize(191, 16777215))
  22. font = QtGui.QFont()
  23. font.setFamily("Taipei Sans TC Beta")
  24. font.setPointSize(14)
  25. font.setBold(False)
  26. font.setWeight(50)
  27. self.tell_pages.setFont(font)
  28. self.tell_pages.setObjectName("tell_pages")
  29. self.start_button = QtWidgets.QPushButton(self.centralwidget)
  30. self.start_button.setGeometry(QtCore.QRect(30, 238, 431, 71))
  31. font = QtGui.QFont()
  32. font.setFamily("Taipei Sans TC Beta")
  33. font.setPointSize(20)
  34. font.setBold(True)
  35. font.setWeight(75)
  36. self.start_button.setFont(font)
  37. self.start_button.setObjectName("start_button")
  38. self.state_table = QtWidgets.QTextBrowser(self.centralwidget)
  39. self.state_table.setGeometry(QtCore.QRect(30, 320, 431, 141))
  40. font = QtGui.QFont()
  41. font.setFamily("有愛ウォークラフト角ゴシック CN")
  42. font.setPointSize(11)
  43. self.state_table.setFont(font)
  44. self.state_table.setMouseTracking(False)
  45. self.state_table.setAcceptDrops(False)
  46. self.state_table.setObjectName("state_table")
  47. self.keyword_input = QtWidgets.QLineEdit(self.centralwidget)
  48. self.keyword_input.setGeometry(QtCore.QRect(30, 50, 431, 31))
  49. font = QtGui.QFont()
  50. font.setFamily("有愛ウォークラフト角ゴシック CN")
  51. font.setPointSize(11)
  52. self.keyword_input.setFont(font)
  53. self.keyword_input.setText("")
  54. self.keyword_input.setObjectName("keyword_input")
  55. self.pages_input = QtWidgets.QLineEdit(self.centralwidget)
  56. self.pages_input.setGeometry(QtCore.QRect(30, 120, 431, 31))
  57. font = QtGui.QFont()
  58. font.setFamily("有愛ウォークラフト角ゴシック CN")
  59. font.setPointSize(11)
  60. self.pages_input.setFont(font)
  61. self.pages_input.setText("")
  62. self.pages_input.setObjectName("pages_input")
  63. self.type_shopee_button = QtWidgets.QPushButton(self.centralwidget)
  64. self.type_shopee_button.setGeometry(QtCore.QRect(30, 160, 211, 71))
  65. font = QtGui.QFont()
  66. font.setFamily("Taipei Sans TC Beta")
  67. font.setPointSize(20)
  68. font.setBold(True)
  69. font.setWeight(75)
  70. font.setKerning(True)
  71. self.type_shopee_button.setFont(font)
  72. self.type_shopee_button.setMouseTracking(True)
  73. self.type_shopee_button.setCheckable(True)
  74. self.type_shopee_button.setAutoExclusive(True)
  75. self.type_shopee_button.setObjectName("type_shopee_button")
  76. self.buttonGroup = QtWidgets.QButtonGroup(MainWindow)
  77. self.buttonGroup.setObjectName("buttonGroup")
  78. self.buttonGroup.addButton(self.type_shopee_button)
  79. self.type_ruten_button = QtWidgets.QPushButton(self.centralwidget)
  80. self.type_ruten_button.setGeometry(QtCore.QRect(250, 160, 211, 71))
  81. font = QtGui.QFont()
  82. font.setFamily("Taipei Sans TC Beta")
  83. font.setPointSize(20)
  84. font.setBold(True)
  85. font.setWeight(75)
  86. font.setKerning(True)
  87. self.type_ruten_button.setFont(font)
  88. self.type_ruten_button.setMouseTracking(True)
  89. self.type_ruten_button.setCheckable(True)
  90. self.type_ruten_button.setAutoExclusive(True)
  91. self.type_ruten_button.setObjectName("type_ruten_button")
  92. self.buttonGroup.addButton(self.type_ruten_button)
  93. self.start_button.raise_()
  94. self.tell_keyword.raise_()
  95. self.tell_pages.raise_()
  96. self.state_table.raise_()
  97. self.keyword_input.raise_()
  98. self.pages_input.raise_()
  99. self.type_shopee_button.raise_()
  100. self.type_ruten_button.raise_()
  101. MainWindow.setCentralWidget(self.centralwidget)
  102. self.menubar = QtWidgets.QMenuBar(MainWindow)
  103. self.menubar.setGeometry(QtCore.QRect(0, 0, 490, 21))
  104. self.menubar.setObjectName("menubar")
  105. MainWindow.setMenuBar(self.menubar)
  106. self.statusbar = QtWidgets.QStatusBar(MainWindow)
  107. self.statusbar.setObjectName("statusbar")
  108. MainWindow.setStatusBar(self.statusbar)
  109.  
  110. self.retranslateUi(MainWindow)
  111. QtCore.QMetaObject.connectSlotsByName(MainWindow)
  112.  
  113. def retranslateUi(self, MainWindow):
  114. _translate = QtCore.QCoreApplication.translate
  115. MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
  116. self.tell_keyword.setText(_translate("MainWindow", "請輸入商品關鍵字:"))
  117. self.tell_pages.setText(_translate("MainWindow", "請輸入搜尋頁數:"))
  118. self.start_button.setText(_translate("MainWindow", "開 始"))
  119. self.type_shopee_button.setText(_translate("MainWindow", "蝦 皮"))
  120. self.type_ruten_button.setText(_translate("MainWindow", "露天"))
  121.  
  122. if __name__ == "__main__":
  123. import sys
  124. app = QtWidgets.QApplication(sys.argv)
  125. MainWindow = QtWidgets.QMainWindow()
  126. ui = Ui_MainWindow()
  127. ui.setupUi(MainWindow)
  128. MainWindow.show()
  129. sys.exit(app.exec_())
Advertisement
Add Comment
Please, Sign In to add comment