小编O. *_*sen的帖子

TypeError:预期的str,字节或os.PathLike对象,而不是元组

因此,我尝试使用GUI创建一种加密程序。这是代码:

import sys
from PyQt4 import QtGui, QtCore
import os
from Crypto.Hash import SHA256
from Crypto import Random
from Crypto.Cipher import AES

class Window(QtGui.QMainWindow):

    def __init__(self):
        super(Window, self).__init__()
        self.setGeometry(50, 50, 500, 300)
        self.setWindowTitle("Encryptionprogram")
        self.setWindowIcon(QtGui.QIcon('pythonicon.png'))

        self.container = QtGui.QWidget()
        self.setCentralWidget(self.container)
        self.container_lay = QtGui.QVBoxLayout()
        self.container.setLayout(self.container_lay)



        extractAction = QtGui.QAction("Leave", self)
        extractAction.setShortcut("Ctrl+Q")
        extractAction.setStatusTip("Leave the app")
        extractAction.triggered.connect(self.close_application)

        mainMenu = self.menuBar()
        fileMenu = mainMenu.addMenu('&File')
        fileMenu.addAction(extractAction)

        #Inputs
        self.Input = QtGui.QLineEdit("Filname", self)

        self.Input.setFixedWidth(200)
        self.Input.setFixedHeight(25)
        self.Input.move(20, 200)
        self.Input.setSizePolicy(QtGui.QSizePolicy.Fixed,
                                 QtGui.QSizePolicy.Fixed)

        self.Input2 = QtGui.QLineEdit("password", self)

        self.Input2.setFixedWidth(200)
        self.Input2.setFixedHeight(25)
        self.Input2.move(220, 200)
        self.Input2.setSizePolicy(QtGui.QSizePolicy.Fixed,
                                  QtGui.QSizePolicy.Fixed)

        self.home() …
Run Code Online (Sandbox Code Playgroud)

python pyqt python-3.x

-4
推荐指数
1
解决办法
1万
查看次数

标签 统计

pyqt ×1

python ×1

python-3.x ×1