Answer the question
In order to leave comments, you need to log in
Why is an error thrown in pyQt5?
I installed Python 3.4.3 and pyQT 5. When I try to create a simple window with the code below, IDLE gives an Invalid Syntax error and, accordingly, the window is not created. I checked the syntax, everything seems to be correct. What could be the reason?
{
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtWidgets import QApplication, QWidget
if __name__ == '__main__':
app = QApplication(sys.argv)
w = QWidget ()
w.resize(250, 150)
w.move(300, 300)
w.setWindowTitle('Simple')
w.show()
sys.exit(app.exec_())
}
Answer the question
In order to leave comments, you need to log in
Because "invalid syntax", you have an invalid syntax.
Since you couldn't paste the formatted code into the question, it's difficult to point out exactly where the error is.
Fix it.
Your _formatted_ code works for me (Ubuntu).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question