gpt4 book ai didi

python - "Process finished with exit code 1"是什么意思?

转载 作者:太空狗 更新时间:2023-10-29 22:24:37 31 4
gpt4 key购买 nike

我试图开发一个简单的货币程序,但遇到了问题。当我点击 Çevir 时,程序应该会计算货币(如兑换)。但我做不到。当我单击 Çevir

时,PyCharm 写入 Process finished with exit code 1
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import qApp


class Ui_MainWindow(object):
def setupUi(self, MainWindow):
....(qtdesigner codes . i skip this part)


self.pushButton.clicked.connect(self.cevirici)
self.pushButton_2.clicked.connect(self.cikis)

self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)

def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.label_2.setText(_translate("MainWindow", "Birinci Döviz"))
self.label.setText(_translate("MainWindow", "İkinci Döviz"))
self.label_3.setText(_translate("MainWindow", "Miktar"))
self.label_4.setText(_translate("MainWindow", "Sonuç :"))
self.pushButton.setText(_translate("MainWindow", "Çevir"))
self.pushButton_2.setText(_translate("MainWindow", "Çıkış Yap"))

def cevirici(self):
import requests

import sys

url = "http://api.fixer.io/latest?base="

birinci_doviz = self.comboBox.currentText()
ikinci_doviz = self.comboBox_2.currentText()

miktar = int(self.lineEdit.currentText())

response = requests.get(url + birinci_doviz)

json_verisi = response.json()


self.lineEdit_2.setText(json_verisi["rates"][ikinci_doviz] * miktar)
def cikis(self):
qApp.quit()

if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())

最佳答案

01 是退出代码,它们不一定是 python 特定的,事实上它们很常见。

exit code (0) 表示没有错误或问题的退出。

exit code (1) 表示存在导致程序退出的问题。

这些代码中的每一个的效果在操作系统之间可能会有所不同,但与 Python 应该相当一致。

关于python - "Process finished with exit code 1"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47970844/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com