Skip to content

Instantly share code, notes, and snippets.

@henryiii
Created August 19, 2013 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henryiii/6274508 to your computer and use it in GitHub Desktop.
Save henryiii/6274508 to your computer and use it in GitHub Desktop.
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