SHARE
TWEET

changed

furas Aug 5th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. # -*- coding: utf-8 -*-
  4.  
  5. # Form implementation generated from reading ui file 'Test.ui'
  6. #
  7. # Created by: PyQt5 UI code generator 5.6
  8. #
  9. # WARNING! All changes made in this file will be lost!
  10.  
  11. from PyQt5 import QtCore, QtGui, QtWidgets
  12. from PyQt5.QtCore import pyqtSlot
  13. from PyQt5.QtWidgets import QApplication,QDialog
  14. from PyQt5.uic import loadUi
  15. from Fran├žais import sum
  16. #from other import sum
  17.  
  18.  
  19. class Ui_MainWindow(object):
  20.    
  21.     def setupUi(self, MainWindow):
  22.         MainWindow.setObjectName("MainWindow")
  23.         MainWindow.resize(930, 573)
  24.         self.centralwidget = QtWidgets.QWidget(MainWindow)
  25.         self.centralwidget.setObjectName("centralwidget")
  26.         self.plainTextEdit = QtWidgets.QPlainTextEdit(self.centralwidget)
  27.         self.plainTextEdit.setGeometry(QtCore.QRect(10, 50, 411, 361))
  28.         self.plainTextEdit.setObjectName("plainTextEdit")
  29.         self.pushButton = QtWidgets.QPushButton(self.centralwidget)
  30.         self.pushButton.setGeometry(QtCore.QRect(20, 490, 75, 23))
  31.         self.pushButton.setObjectName("pushButton")
  32.         self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget)
  33.         self.pushButton_2.setGeometry(QtCore.QRect(130, 490, 75, 23))
  34.         self.pushButton_2.setObjectName("pushButton_2")
  35.         self.label1 = QtWidgets.QLabel(self.centralwidget)
  36.         self.label1.setGeometry(QtCore.QRect(460, 52, 451, 351))
  37.         self.label1.setText("")
  38.         self.label1.setObjectName("label1")
  39.         MainWindow.setCentralWidget(self.centralwidget)
  40.         self.menubar = QtWidgets.QMenuBar(MainWindow)
  41.         self.menubar.setGeometry(QtCore.QRect(0, 0, 930, 21))
  42.         self.menubar.setObjectName("menubar")
  43.         self.menuFile = QtWidgets.QMenu(self.menubar)
  44.         self.menuFile.setObjectName("menuFile")
  45.         self.menuEdit = QtWidgets.QMenu(self.menubar)
  46.         self.menuEdit.setObjectName("menuEdit")
  47.         MainWindow.setMenuBar(self.menubar)
  48.         self.statusbar = QtWidgets.QStatusBar(MainWindow)
  49.         self.statusbar.setObjectName("statusbar")
  50.         MainWindow.setStatusBar(self.statusbar)
  51.         self.actionSave = QtWidgets.QAction(MainWindow)
  52.         self.actionSave.setObjectName("actionSave")
  53.         self.actionOpen = QtWidgets.QAction(MainWindow)
  54.         self.actionOpen.setObjectName("actionOpen")
  55.         self.actionSave_as = QtWidgets.QAction(MainWindow)
  56.         self.actionSave_as.setObjectName("actionSave_as")
  57.         self.actionCut = QtWidgets.QAction(MainWindow)
  58.         self.actionCut.setObjectName("actionCut")
  59.         self.actionCopy = QtWidgets.QAction(MainWindow)
  60.         self.actionCopy.setObjectName("actionCopy")
  61.         self.actionPaste = QtWidgets.QAction(MainWindow)
  62.         self.actionPaste.setObjectName("actionPaste")
  63.         self.menuFile.addAction(self.actionSave)
  64.         self.menuFile.addAction(self.actionOpen)
  65.         self.menuFile.addAction(self.actionSave_as)
  66.         self.menuEdit.addAction(self.actionCut)
  67.         self.menuEdit.addAction(self.actionCopy)
  68.         self.menuEdit.addAction(self.actionPaste)
  69.         self.menubar.addAction(self.menuFile.menuAction())
  70.         self.menubar.addAction(self.menuEdit.menuAction())
  71.  
  72.         self.retranslateUi(MainWindow)
  73.         QtCore.QMetaObject.connectSlotsByName(MainWindow)
  74.        
  75.         self.pushButton.clicked.connect(self.on_click)
  76.  
  77.     def retranslateUi(self, MainWindow):
  78.         _translate = QtCore.QCoreApplication.translate
  79.         MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
  80.         self.pushButton.setText(_translate("MainWindow", "Resume"))
  81.         self.pushButton_2.setText(_translate("MainWindow", "Clear"))
  82.         self.menuFile.setTitle(_translate("MainWindow", "File"))
  83.         self.menuEdit.setTitle(_translate("MainWindow", "Edit"))
  84.         self.actionSave.setText(_translate("MainWindow", "Save"))
  85.         self.actionOpen.setText(_translate("MainWindow", "Open"))
  86.         self.actionSave_as.setText(_translate("MainWindow", "Save as"))
  87.         self.actionCut.setText(_translate("MainWindow", "Cut"))
  88.         self.actionCopy.setText(_translate("MainWindow", "Copy "))
  89.         self.actionPaste.setText(_translate("MainWindow", "Paste"))
  90.        
  91.     def on_click(self):
  92.         text = self.plainTextEdit.toPlainText()
  93.         summary = sum(text)
  94.         self.label1.setText(summary)
  95.        
  96.    
  97.    
  98. if __name__ == "__main__":
  99.     import sys
  100.     app = QtWidgets.QApplication(sys.argv)
  101.     MainWindow = QtWidgets.QMainWindow()
  102.     ui = Ui_MainWindow()
  103.     ui.setupUi(MainWindow)
  104.     MainWindow.show()
  105.     sys.exit(app.exec_())
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top