Skip to content
Advertisement

How do I run a Python Qt file in Ubuntu?

Here’s the sample code that I want to run:

JavaScript

The file is saved as sample.py. The following command isn’t working:

JavaScript

Advertisement

Answer

You need to start the Qt event loop by calling app.exec_() once you have initialised the widgets and called show() on your main window.

JavaScript
Advertisement