exit code -1073740791 (0xC0000409) problem

import sys
from PyQt5.QtWidgets import *

class Window(QWidget):
def __init__(self):
super().__init__()
self.setGeometry(50, 50, 800, 500)
self.setWindowTitle('GE Maintenance')
self.UI()

def UI(self):
self.nameTextBox = QLineEdit(self)
self.nameTextBox.setPlaceholderText('Enter your name')
self.nameTextBox.move(100, 50)
self.surnameTextBox = QLineEdit(self)
self.surnameTextBox.setPlaceholderText('Enter your surname')
self.surnameTextBox.move(100, 80)
self.male = QRadioButton('Male', self)
self.male.move(100, 110)
self.male.setChecked(True)
self.female = QRadioButton('Female', self)
self.female.move(170, 110)
button1 = QPushButton('submit', self)
button1.move(150, 150)
button1.clicked.connect(self.getValue)
self.show()

def getValue(self):
name=self.name.text()
surname=self.surname.text()
if self.male.isChecked():
print(' you are a male')
else:
print(' you are a female')

def main():
App = QApplication(sys.argv)
window = Window()
sys.exit(App.exec_())

if __name__ == '__main__':
main()
0
1 comment

Hello, 

 

The script provided works for me. 

 

Are you able to run it out of PyCharm with the same interpreter? 

 

For more information on how to run your code from the terminal outside of IDE, please see the following article:
https://docs.python.org/3/using/cmdline.html#command-line

If you're using virtualenv interpreter in PyCharm, you may need to activate it in the command line prior to running your code:
https://virtualenv.pypa.io/en/latest/user_guide.html#activators

0

Please sign in to leave a comment.