lis=[]
for row2 in page.html.body.findAll("div","recipe-ing"):
spans = row2.ul.find("li","cat").findAll("span")
for span in spans:
if span.string != None:
lis.append(span.string)
import sys
from PyQt5.QtCore import QObject, Qt
from PyQt5.QtWidgets import (
QApplication, QMainWindow, QWidget,
QLabel, QDoubleSpinBox, QPushButton,
QVBoxLayout, QMessageBox)
class Example (QMainWindow):
def __init__(self):
super().__init__()
self.initUI()
self.__initSignals()
def initUI(self):
self.w = QWidget(self)
self.mainLayout = QVBoxLayout(self.w)
self.convertBtn = QPushButton('Перевести', self)
self.mainLayout.addWidget(self.convertBtn)
self.setCentralWidget(self.w)
def __initSignals(self):
self.convertBtn.clicked.connect(self.summm) # отработка нажатия по кнопке
def summm(self):
print(100+100)
def KeyPressEvent(self,e):
if e.key() == Qt.Key_Q:
print("ошибка")
#self.__initSignals()
else:
print("ошибка1")
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = Example()
ex.show()
sys.exit(app.exec_())