Restart ibus-daemon to unlock keyboard input (run ibus-daemon -rd). To prevent further locks: Go to "Help | Edit Custom VM options..." Add -Drecreate.x11.input.method=true to a new line Restart IDE
Here is what the above code is Doing:
This imports the sys module, which is a module that contains many system-specific parameters and functions.
from PyQt5.QtWidgets import QApplication, QWidget
This imports the QApplication and QWidget classes from the PyQt5.QtWidgets module.
if __name__ == '__main__':
This is a special Python idiom that is used to determine if the script is being run standalone by the user or being imported into another module.
app = QApplication(sys.argv)
This creates an instance of the QApplication class. The sys.argv parameter is a list of arguments from a command line. Python scripts can be run from the shell. It is a way for the user to communicate with the script.
w = QWidget()
This creates an instance of the QWidget class.
This resizes the widget to a width of 250 pixels and a height of 150 pixels.
This moves the widget to a position on the screen at 300 pixels from the left edge and 300 pixels from the top of the screen.
This sets the title of the widget to “Simple”.
This shows the widget on the screen.
This enters the mainloop of the application, waiting for events (user actions). The mainloop receives events from the window system and dispatches them to the application widgets. The mainloop ends if we call the exit() method, or the main widget is destroyed. The sys.exit() method ensures a clean exit. The environment will be informed, how the application ended.
The exec_() method has an underscore. It is because the exec is a Python keyword. And thus, exec_() was used instead.