Intro/basic GUI - PyQt with Python GUI Programming tutorial

sentdex · 718K views · 2015 · 12:56

Open on YouTube

Python, Ruby & scripting languagesSoftware (other)tutorialdated

Why Stack Overflow recommends it

Stack Overflow users cite it as the tutorial they were following when their PyQt window closed immediately or PyQt4 and PyQt5 would not install or import.

Recommended by 0 people across 0 different months, 2015 to 2017.

What it is

A 13-minute beginner tutorial from sentdex that introduces PyQt4, the Python wrapper around the Qt GUI framework. It covers installation, the main PyQt modules (QtCore, QtGui, QtNetwork, QtSql and others), and builds a basic window with a QApplication and QWidget.

What people said

Cites user5162426 · 2015-08 · Stack Overflow · on “PyQt QWidget window closes immediately upon showing?”

I realize that this question has been asking several times before, though none of them seem to apply to my situation. I have installed PyQt, and am simply trying to open up a window as such: import sys from PyQt4 import QtGui as qt segmentation = qt.QApplication(sys.argv) main = qt.QWidget() main.show() All the other questions I have looked at on here usually were caused by an error with the window going out of scope because of the window's show method being called from within a function, or something similar. My code uses no functions at all so this cannot be the issue. This should work as it is, no? I am following this tutorial: [this video] and at time 8:58, the instructor has pretty much exac

Cites smilingbuddha · 2016-01 · Stack Overflow · on “GUI window in Python (PyQT) flashing and closing down immediately?”

I am new to PyQT and I have just started learning about it through this video: [this video] When I ran the code on my Ubuntu 14.04 import sys from PyQt4 import QtGui # Always have these two imports app = QtGui.QApplication(sys.argv) window = QtGui.QWidget() window.setGeometry(50,50,500,300) window.setWindowTitle("PyQt start") window.show() The window crated just flashes and closes down. How do I get the window to stay so that I can interact with it? The code in the Youtube video above demonstrated it on a Windows platform. Do I have to append anything Ubuntu specific to my code?

Cites Mark · 2017-06 · Stack Overflow · on “When I try and import pyqt4 in pycharm it says "ModuleNotFoundError: No module named 'PyQt4'"”

I have Anaconda Distribution installed and installed pyqt4 using sourceforge (link below), but when I try and import pyqt4 in pycharm it says "ModuleNotFoundError: No module named 'PyQt4'" sourceforge link: [LINK]  I have been looking up tutorial videos on how to develop a basic desktop application and stumbled upon this guy "sentdex" (youtube) I was attempting to follow his code but was getting errors his code: [this video] I know I have pyqt5 with anaconda, but everyone seems to recommend against that version so I tried to install pyqt4 separately so I could work on my project. However, pycharm isn't able to reference it when I try and import PyQt4. Any help would be amazing. I'm relatively ne

Cites Josephine · 2017-11 · Stack Overflow · on “PyQt5 Installation”

I am new to the world of python and I was hoping you could help with my PyQt5 installation troubles. I have downloaded PyQt5 (zip folder) for Windows and extracted onto my desktop. Source: [LINK] As instructed in the read me file, I have also installed the latest SIP package (also extracted to the desktop) and I have run the configure.py in python 3.5 to receive the following error: Error: Use the --qmake argument to explicitly specify a working Qt qmake. Does anyone know why this may be? Or how I fix it and complete the install? Additionally, I have watched a tutorial on YouTube... [this video] However when trying to run his code (shown below) I get the: 'ImportError: No module named 'PyQt5' Is