Python Forum
[PyQt] My WIndow isnt opening at all.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] My WIndow isnt opening at all.
#1
import sys
from PyQt5.QtWidgets import *


class MainWindow(QMainWindow):
    def __init__(self):
        super(MainWindow, self).__init__()
        self.showMaximized()


app = QApplication(sys.argv)
QApplication.setApplicationName('Chrome Killer')
it is supposed to open a black window called "Chrome Killer" but it does nothing i dont know what to do. Please help.
buran write Apr-24-2021, 10:30 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.

Thread moved to GUI
Reply
#2
You didn't create an instance of MainWindow or call app.exec_
import sys

from PyQt5.QtWidgets import *


class MainWindow(QMainWindow):
    def __init__(self):
        super(MainWindow, self).__init__()
        self.showMaximized()


app = QApplication(sys.argv)
QApplication.setApplicationName('Chrome Killer')
mainwindow = MainWindow()
sys.exit(app.exec_())
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Interaction between Matplotlib window, Python prompt and TKinter window NorbertMoussy 3 490 Mar-17-2024, 09:37 AM
Last Post: deanhystad
  [PyQt] Opening new window ifigazsi 2 1,902 Jan-20-2021, 04:16 PM
Last Post: ifigazsi
  tkinter window and turtle window error 1885 3 6,716 Nov-02-2019, 12:18 PM
Last Post: 1885
  update a variable in parent window after closing its toplevel window gray 5 9,082 Mar-20-2017, 10:35 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020