Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. from PyQt5 import QtCore, QtGui, QtWidgets
  2. import sys, random
  3. import cipher ## Designed GUI
  4.  
  5. LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
  6.  
  7.  
  8.  
  9. class CipherDesign(QtWidgets.QMainWindow, cipher.Ui_MainWindow):
  10. def __init__(self, parent=None):
  11. super(CipherDesign, self).__init__(parent)
  12. self.setupUi(self)
  13. self.BGenerate.clicked.connect(self.generatekey) # Generate Button
  14. self.BSubmit.clicked.connect(self.submitkey) # Submit Button
  15.  
  16. def generatekey(self):
  17. key = list(LETTERS)
  18. random.shuffle(key)
  19. self.keytext.setText(''.join(key))
  20. print (key) ##### DELETE ####
  21.  
  22. def submitkey(self):
  23. submittedkey = []
  24. self.keytext_2.getText(''.join(submittedkey))
  25. print (submittedkey) #### DELETE ####
  26.  
  27.  
  28.  
  29. def main():
  30. myMessage = ''
  31. myMode = ''
  32. myKey = 'submitkey(self)'
  33. app = QtWidgets.QApplication(sys.argv)
  34. form = CipherDesign()
  35. form.show()
  36. app.exec_()
  37.  
  38.  
  39. if __name__ == "__main__":
  40. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement