import sys
from wikides import *
from wikicore import *
from PyQt5 import QtCore, QtGui, QtWidgets
class MyWin(QtWidgets.QMainWindow):
def __init__(self, parent=None):
QtWidgets.QWidget.__init__(self, parent)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.path = os.path.dirname(__file__)
self.pathTemp = self.path +'/temp'
# Клик по кнопке.
self.ui.pushButton.clicked.connect(self.WikiGo)
def WikiGo(self):
cmd = recToText()
self.showText(cmd)
# ....... и т. д.
def keyPressEvent(self, e):
if e.key() in [QtCore.Qt.Key_Enter, QtCore.Qt.Key_Return]:
self.WikiGo()
else:
super(MyWindow, self).keyPressEvent(e)