This is the code that i write following this " PyQT Python GUI Application Development with Python" tutorial
https://www.youtube.com/playlist?list=PLQVvvaa0QuDdVpDFNq4FwY9APZPGSUyR4
Do not expect exactly the same variable names, but it has the same fucntionality, i tested it on raspberry pi 3
install pyqt4
$sudo apt-get install python-qt4
install qt designer
$sudo apt-get install qt4-designer
install pyuic4 tool
$sudo apt-get install pyqt4-dev-tools