[PYTHON] Display GUI messages on Ubuntu

A Python program that displays GUI messages on Ubuntu

GUI library download

sudo apt-get install python-qt4
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *

class UI(QMainWindow):
    def __init__(self):
        super(UI, self).__init__()
        self.initUI()

    def initUI(self):

        # Warning Message box
        QMessageBox.warning(self, "Message", u"something wrong")

        self.show()


def main():
    app = QApplication(sys.argv)
    ui = UI()
    sys.exit(app.exec_())

if __name__ == '__main__':
    main()

Reference URL http://myenigma.hatenablog.com/entry/2016/01/24/113413

Recommended Posts

Display GUI messages on Ubuntu
RTKLIB 2.4.3 CLI version GUI version installed on Ubuntu 18.04
Shebang on Ubuntu 20.04
Install TensorFlow on Ubuntu
Install PySide2 on Ubuntu
Install JModelica on Ubuntu
build Python on Ubuntu
Install Python 3.3 on Ubuntu 12.04
Installing pyenv on ubuntu 16.04
Install Theano on Ubuntu 12.04
Install angr on Ubuntu 18.04
Install pip / pip3 on Ubuntu
Error around GUI when using PyQt5 on Ubuntu (WSL2)
Set up Python 3.4 on Ubuntu
I installed tensorRT on Ubuntu 18.04
Run Jupyter on Ubuntu on Windows
SoftwareRAID 0 on SereneLinux (Ubuntu 18.04 Desktop)
Display PIL images on Jupyter
I installed ROS on Ubuntu 18.04
USB Wifi on Ubuntu 20.04LTS
Set matplotlib font on ubuntu
Put Python 3.x on Ubuntu
Rebuild kernel on Ubuntu 20.04 (on Azure)
Operate ubuntu on VScode (windows10)
Create command shortcuts on Ubuntu 16.04
Install GoLand IDE on Ubuntu
Install OpenCV on Ubuntu + python
wsl Install PostgreSQL on Ubuntu 18.04
Introducing TensorFlow on Ubuntu + Python 2.7
[ROS] Install ROS (melodic) on Ubuntu (18.04)
Install Caffe on Ubuntu 14.04 (GPU)
Install Docker on WSL Ubuntu 18.04
Use Xming to launch an Ubuntu GUI application on Windows.
Display the image of the camera connected to the personal computer on the GUI.
I tried to display GUI on Mac with X Window System
Weighing instrument using raspberry pi and hx711 (GUI display on Tkinter)
Install CUDA10.1 + cuDNN7.6.5 + tensorflow-2.3.0 on Ubuntu 18.04
Install Python 3.8 on Ubuntu 18.04 (OS standard)
Changed partition mount point on Ubuntu
Install Caffe on Ubuntu 14.04 (CPU mode)
Prepare Python development environment on Ubuntu
Run MuJoCo on WSL (2) (also GUI)
Display multiple markers on Google Map
Install and run dropbox on Ubuntu 20.04
Install OpenCV and Chainer on Ubuntu
Building a Python environment on Ubuntu
Install CUDA 8.0 and Chainer on Ubuntu 16.04
Install Python 3.8 on Ubuntu 20.04 (OS standard)
Introducing Python using pyenv on Ubuntu 20.04
Preparing python using vscode on ubuntu
Draw Japanese with matplotlib on Ubuntu
Mount S3 on Ubuntu with goofys
I tried Cython on Ubuntu on VirtualBox
Install fabric on Ubuntu and try
Display the absolute path on the Finder
Using a serial console on Ubuntu 20.04
Run XGBoost on Bash on Ubuntu on Windows
I couldn't input Japanese on Ubuntu 20.04
Install Python 3.9 on Ubuntu 20.04 (OS standard?)
Install confluent-kafka for Python on Ubuntu
Install Python 2.7 on Ubuntu 20.04 (OS standard?)