小编dai*_*yan的帖子

python:使用PyCharm和PyQt5时,进程以退出代码1结束

我有三个Python(3.4.3)脚本.其中一个用于控制PyQt5生成的.ui文件.当我运行GUI程序时,它接受所有数据和所有内容,当我按下InputDialog上的OK按钮时,窗口关闭,控制台显示.

Process finished with exit code 1

当我在Python IDLE上运行相同的代码时,它显示:

<<<<<<RESTART>>>>>>

当我在Visual Studio上使用相同的Python(3.4.3或2.7)代码时,这种情况从未发生过.可能是什么原因?

这是控制.ui文件的python文件的代码.

import sys
from PyQt5 import QtCore, QtGui, uic, QtWidgets
from Email import encrypt_email
from Email import decrypt_email
from Email import newuser

qtCreatorFile = "rsegui.ui" # Enter file here.

Ui_MainWindow, QtBaseClass = uic.loadUiType(qtCreatorFile)

class MyApp(QtWidgets.QMainWindow, Ui_MainWindow):
    def __init__(self):
        QtWidgets.QMainWindow.__init__(self)
        Ui_MainWindow.__init__(self)
        self.setupUi(self)
        user, ok = QtWidgets.QInputDialog.getText(self, 'New User', 
    'Are you a new user?')
        user=str(user)
        if user in "YESYesyesYy":
            email, ok = QtWidgets.QInputDialog.getText(self, 'New User', 
    'Enter Your Email ID:')
            email1=str(email) …
Run Code Online (Sandbox Code Playgroud)

python pyqt pycharm pyqt5

6
推荐指数
1
解决办法
3万
查看次数

如何从文件读取字节到byte []数组?

我正在编写一个Java程序,它使用RSA加密给定的文本,并将加密的字节(byte []数组)保存在.txt文件中.有一个单独的解密程序读取这些字节.现在我想将相同的字节读入解密程序的byte []中.如何使用Java完成?

BufferedReader brip = new BufferedReader(new FileReader("encrypted.txt"));
Strings CurrentLine = brip.readLine();
byte[] b = sCurrentLine.getBytes();
Run Code Online (Sandbox Code Playgroud)

这就是我从文件中读取数据的方式.但这是错误的,因为它将sCurrentLine变量中的字节转换为再次字节.

java byte bytearray file

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

标签 统计

byte ×1

bytearray ×1

file ×1

java ×1

pycharm ×1

pyqt ×1

pyqt5 ×1

python ×1