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