Python成生随机KEY工具
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python成生随机KEY工具相关的知识,希望对你有一定的参考价值。
# -*- coding: utf-8 -*- from PyQt4.QtCore import pyqtSignature from PyQt4.QtGui import QDialog from PyQt4 import QtGui,QtCore from Ui_CreateKey import Ui_CreateKey import base64,uuid class CreateKey(QDialog, Ui_CreateKey): def __init__(self, parent=None): QDialog.__init__(self, parent) self.clipboard = QtGui.QApplication.clipboard() self.setupUi(self) QtCore.QObject.connect(self.pushButton_3,QtCore.SIGNAL("clicked()"),self.clear) QtCore.QObject.connect(self.pushButton_2,QtCore.SIGNAL("clicked()"),self.getkey) @pyqtSignature("") def on_pushButton_clicked(self): key = base64.b64encode(uuid.uuid4().bytes + uuid.uuid4().bytes) self.textBrowser.append(str(key)) @pyqtSignature("") def clear(self): self.textBrowser.clear() @pyqtSignature("") def getkey(self): self.clipboard.setText(self.textBrowser.toPlainText().split(‘\n‘)[-1]) if __name__ == "__main__": import sys app = QtGui.QApplication(sys.argv) ui = CreateKey() ui.show() sys.exit(app.exec_())
本文出自 “xwb” 博客,请务必保留此出处http://xiewb.blog.51cto.com/11091636/1792299
以上是关于Python成生随机KEY工具的主要内容,如果未能解决你的问题,请参考以下文章