Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
pyqttemplate.py
#!\usr\bin\env python
from PyQt4 import QtCore, QtGui, uic
import sys
import os
Slot = QtCore.pyqtSlot
Signal = QtCore.pyqtSignal
LoadUI = uic.loadUi
if getattr(sys, 'frozen', None):
LOCDIR = sys._MEIPASS
else:
LOCDIR = os.path.dirname(__file__)
class MyClass(QtGui.QMainWindow):
def __init__(self):
super(MyClass,self).__init__()
# Set up the user interface from Designer.
LoadUI(os.path.join(LOCDIR,"MyFile.ui"), self)
self.setupUI()
self.show()
def setupUI(self):
pass
def main():
app = QtGui.QApplication(sys.argv)
mainapp = MyClass()
app.exec_()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.