Advertisement
Guest User

Untitled

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