class Application(Thread): """ читает конфиг запускает """ Connect = None Wnd = None def __init__(self): Thread.__init__(self) def run(self): app = QApplication(sys.argv) app.setStyle("Cleanlooks") QgsApplication.setPrefixPath("/usr", True) QgsApplication.initQgis() self.inerface = MainWindow() self.inerface.show() retval = app.exec_() QgsApplication.exitQgis() sys.exit(retval) print("Client starting...") self.inerface.join() print("Application end...")
class Capturador: def __init__(self): self.config = Configuration("./resources/prueba.xml") self.prefDialog = PreferencesDialog(self.config) self.faceSign = FaceSignature() self.captureDevice= CaptureDevice(self) self.MW = MainWindow(self) self.setCaptureDevice() self.MW.mainWindow.show() gtk.main() def openPreferencesDialog(self, tab=0): cameraAux = self.config.cameraDevice self.prefDialog.preferencesDialog.run() self.prefDialog.preferencesDialog.hide() if self.config.cameraDevice!=cameraAux: self.setCaptureDevice() def setCaptureDevice(self): try : self.captureDevice.setCaptureParameters(self.config.cameraDevice, self.config.cascadeFile) except CaptureDeviceParametersException ,e: self.MW.exceptionMessageDialog("Errores en dispositivo de captura", e.__str__()) self.openPreferencesDialog(0)
def script_Properties_scalarBarPosition(id, type, obj_id, colName, tep_orietation, pos0, pos1, pos2, pos3): MainWindow.script_Properties_scalarBarPosition(id, type, obj_id, colName, tep_orietation, pos0, pos1, pos2, pos3) pass
def main(): parser = argparse.ArgumentParser( description='{{ cookiecutter.description }}', version=VERSION ) # parser.add_argument( # 'filename', # metavar='script.py', # help='The script to debug.' # ) # parser.add_argument( # 'args', nargs=argparse.REMAINDER, # help='Arguments to pass to the script you are debugging.' # ) options = parser.parse_args() # Set up the root Tk context root = Tk() # Construct a window debugging the nominated program view = MainWindow(root, options) # Run the main loop try: view.mainloop() except KeyboardInterrupt: view.on_quit()
def do_activate(self): win = MainWindow(self) win.show_all() localeHelper = LocaleHelper() lang = localeHelper.getLocale() t=gettext.translation('google2ubuntu',os.path.dirname(os.path.abspath(__file__))+'/i18n/',languages=[lang]) t.install()
def run(self): app = QtGui.QApplication(sys.argv) mainWindow = MainWindow() mainWindow.show() QtCore.QTimer.singleShot(0, mainWindow.appinit) sys.exit(app.exec_())
def script_Camera_Reset( id, type, ): MainWindow.script_Camera_Reset( id, type, ) pass
def order(self): link = MainWindow.selectedLink validateCode = self.capBox.text() placeNum = self.spinBox.value() print(validateCode) respond = sc.reg_post(link, validateCode, placeNum) MainWindow.status_update() MainWindow.msg(' ', respond) self.close()
def startGame(self, username, playerList, event=None): if self.currentWindow: self.currentWindow.Destroy() # TRANSLATORS: main window title self.mainFrame = MainWindow(None, -1, _("London Law"), username, playerList, messenger, shutdown) self.mainFrame.SetSize((1000, 740)) self.mainFrame.Show(1) self.currentWindow = self.mainFrame return self.mainFrame
def OnOpenRepository(self, e): repodir = wx.DirSelector("Open repository") if not repodir: return try: repo = Repository(repodir) new_win = MainWindow(repo) new_win.Show(True) except GitError, msg: wx.MessageBox(str(msg), 'Error', style=wx.OK | wx.ICON_ERROR)
def do_activate(self): win = MainWindow(self) win.show_all() localeHelper = LocaleHelper() lang = localeHelper.getLocale() t = gettext.translation('google2ubuntu', os.path.dirname(os.path.abspath(__file__)) + '/i18n/', languages=[lang]) t.install()
def on_printAction1_triggered(self): global received_mails received_mails['正常邮件'].clear() received_mails['垃圾邮件'].clear() self.backend.terminate() self.close() dialog = logindialog(mode=1) if dialog.exec_() == QDialog.Accepted: the_window = MainWindow(self.im) self.windowList.append(the_window) # 这句一定要写,不然无法重新登录 the_window.show()
def logBtn(self): login = self.loginEdit.text() password = self.passwordEdit.text() status = self.checkAuth(login, password) if status == 1: self.mainWin = MainWindow(self.token, login) self.mainWin.show() self.close() elif status == 0: self.incorrectData.setText("Invalid login or password") else: self.incorrectData.setText("Cannot connect to server")
def main(): # Qt main application instance application = QtGui.QApplication(sys.argv) # Set everything to UTF-8 QtCore.QTextCodec.setCodecForCStrings( QtCore.QTextCodec.codecForName("UTF-8")) mainwindow = MainWindow() mainwindow.show() sys.exit(application.exec_())
def CheckPassword(self): Password = self.PasswordInputField.text() msg = QMessageBox() msg.setWindowTitle("Login") msg.setText("Wrong Password") if Password == "Admin": self.MainWindow = MainWindow() self.MainWindow.show() self.hide() else: msg.exec_() self.PasswordInputField.clear()
def OpenRepo(self, repo=None): # Find the first empty window (if exists) win = None for app_window in self.app_windows: if not app_window.mainRepo: win = app_window break if win: # Open repository in existing empty window win.SetMainRepo(repo) else: # Create a new window win = MainWindow(repo) win.Show(True)
def __init__(self): self.menuBar.addmenuitem( 'Plugin', 'command', 'MOLE', label='MOLE 2.5', command=lambda s=self: MainWindow.MainWindow())
def __init__(self, parent=None): QtGui.QMainWindow.__init__(self) self.ui = MainWindow.Ui_MainWindow() self.ui.setupUi(self) self.db = QtSql.QSqlDatabase.addDatabase("QMYSQL") self.db.setHostName("localhost") self.db.setDatabaseName("dancebook") self.db.setUserName("root") self.db.setPassword("") self.db.open() self.model = QtSql.QSqlQueryModel() self.model.setQuery("SELECT name FROM dance", self.db) self.ui.dance_form_table.setModel(self.model) self.ui.dance_form_table.clicked.connect(self.selcon) self.ui.dance_form_table.setMaximumWidth(120) self.ui.plainTextEdit.setStyleSheet(""" border: 2px solid black; background-color: #773467; color : #56DD35; """) self.o = My_Thread(self) #objest of My_t=Thread class self.o.start() # for starting the thread
def main(): logfile = None testfile = None i = 0 while i < len(sys.argv): if sys.argv[i] == '-l': logfile = sys.argv[i + 1] i += 2 elif sys.argv[i] == '-t': testfile = sys.argv[i + 1] i += 2 else: i += 1 logger = InteractionLogger(logfile) logger.start() tester = TestingData.loadTestingFile(testfile) app = QtGui.QApplication(sys.argv) wc = WitnessCam(logger, tester) ex = MainWindow(wc, logger, tester) if tester is not None and tester.automate: tester.setMainTestingWindow(ex) tester.runtest() else: sys.exit(app.exec_())
def main(): app = QApplication(sys.argv) window = MainWindow() # Start the event loop. app.exec_()
def main(argv): QTextCodec.setCodecForTr(QTextCodec.codecForName('utf-8')) parsed_args = parseArguments(argv) logger = createLogger(parsed_args.IsDebugging) logger.debug('Create application.') app = QApplication(argv) if hasattr(parsed_args, 'Language') and not parsed_args.Language is None: translator = createTranslator(parsed_args.Language) app.installTranslator(translator) window = MainWindow.MainWindow() logger.debug('Check to execute a CUI mode.') if(parsed_args.InputFiles): logger.debug('Enter the CUI mdoe.') for file in parsed_args.InputFiles: try: window.convert(file) except e as Exception: logger.error('Failed to conversion %s', file) logger.debug(e) logger.info('Finished to convert all files.') return logger.debug('Enter the GUI mode.') window.show() sys.exit(app.exec_())
def __init__(self): super(MainWindow, self).__init__() self.ui = MW.Ui_Form() self.ui.setupUi(self) id = QFontDatabase.addApplicationFont('Roboto-Light.ttf') str = QFontDatabase.applicationFontFamilies(id)[0] font = QFont(str) font.setPixelSize(14) self.ui.label.setFont(font) self.ui.pushButton.setFont(font) self.painter = Painter() self.painter.setSizePolicy( QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)) self.ui.painterLayout.addWidget(self.painter) self.setMaximumSize(QSize(500, 550)) self.setMinimumSize(QSize(500, 550)) self.ui.pushButton.clicked.connect(self.painter.erase) self.classifier = mnn.ImgClassifier('numbers_data_11')
def launch(): app = QtGui.QApplication(sys.argv) window = MainWindow.MainWindow() window.show() app.connect(app, QtCore.SIGNAL("lastWindowClosed()"), app, QtCore.SLOT("quit()")) sys.exit(app.exec_())
def handleLogin(self): # print('login clicked!') username = self.ui.username.text() password = self.ui.password.text() # 发送数据报 message = HandleMessage.generate(TYPE_LOGIN, username, password) UDPMessage.sendUDPMessage(self.dataSocket, self.address, message) # 接受数据报 data, address = UDPMessage.receiveUDPMessage(self.dataSocket) ans = HandleMessage.read(data) title = '登录结果' if ans and (ans != False): message = '登录成功' MessageBox.MessageBox(message, title).launch() self.ui.close() MainWindow.MainWindow(self.dataSocket, self.address, username, ans[1], ans[2]).launch() self.username = username else: if ans is None: message = '您已登录,无法重复登录' MessageBox.MessageBox(message, title).launch() else: message = '用户名或密码错误' MessageBox.MessageBox(message, title).launch()
def start_main(self): # 初始化本终端信息 CM.PL.IPv4 = self.loginwindow.myIPv4 CM.PL.Nid = int('0x' + self.loginwindow.myNID, 16) CM.PL.rmIPv4 = self.loginwindow.rmIPv4 mw.HOME_DIR = self.loginwindow.filetmppath mw.DATA_PATH = self.loginwindow.configpath # print(f'before HOME_DIR{mw.HOME_DIR} DATA_PATH{mw.DATA_PATH}') self.window = mw.MainWindow() ESS.ESSsignal.output.connect(self.window.handleMessageFromPkt) self.window.actionWindows.triggered.connect(self._setStyle) self.window.actionwindowsvista.triggered.connect(self._setStyle) self.window.actionFusion.triggered.connect(self._setStyle) self.window.actionQdarkstyle.triggered.connect(self._setStyle) self.window.show() # 连接后端信号槽 thread_monitor = CM.Monitor(message=app.window.handleMessageFromPkt, path=app.window.getPathFromPkt) thread_monitor.setDaemon(True) thread_monitor.start() # 测试 CM.PL.RegFlag = 1 # nid = "b0cd69ef142db5a471676ad710eebf3a" # CM.PL.PeerProxys[int(nid, 16)]='192.168.50.62' nid = "d23454d19f307d8b98ff2da277c0b546" CM.PL.PeerProxys[int(nid, 16)] = '192.168.50.199'
def InitializeComponent(): try: win = tk.Tk() win.title("MainWindow") tabControl = ttk.Notebook(win) Login = LoginGUI(tabControl) Feed_Request = FeedRequest(tabControl) Order_Report = OrderReport(tabControl) objstatus = Status(tabControl) objAlert = Alert(tabControl) tabControl.add(Login, text='Login') tabControl.add(Feed_Request, text='Feed Request') tabControl.add(Order_Report, text='Order Report') tabControl.pack(expand=1, fill="both") tabControl.add(objstatus, text='Status') tabControl.add(objAlert, text='Alert') scr = ScrollViewer(win) scr.pack(expand=1, fill='both') threadList = [ "ParseResponseQ", "ParseSendRequestQ", "sendorder", "ProcessAmbiOrdes" ] for threads in threadList: thread = MainWindow.ThreadStart(threads) thread.start() win.mainloop() except: logger.exception(PrintException())
def __init__(self): app = 0 app = QtWidgets.QApplication(sys.argv) super().__init__() MainProgram = QMainWindow() self.ui = MainWindow.Ui_MainWindow() self.ui.setupUi(MainProgram) self.flag_preview = 1 self.timer_camera = QtCore.QTimer() self.timer_serial = QtCore.QTimer() self.timer_camera.timeout.connect(self.show_camera) self.timer_serial.timeout.connect(self.serial_timer_trigger) self.cap = [] self.N = 4 self.base_file_name = 'Video' self.path = './' self.video_out = [] self.txt_out = [] self.flag_recording = 0 self.start_time = 0 self.action_connect() MainProgram.show() self.ui.release_cameras.setEnabled(False) self.ui.Button_endrecording.setEnabled(False) sys.exit(app.exec_())
def main(): # Create a GUI? # Initialize Application With Settings if not os.path.exists('settings.json'): defaultSettings = {} defaultSettings['Settings'] = {} defaultSettings['Settings']['Default_User'] = "******" with open('settings.json', 'w') as outfile: json.dump(defaultSettings, outfile) # Load Settings try: with open('settings.json') as settingsjson: settings = json.load(settingsjson) active_user = settings["Settings"]['Default_User'] except FileNotFoundError: wx.MessageBox('No Settings were found.', 'Info', wx.OK | wx.ICON_INFORMATION) # Load Routines if any exist try: with open('./profiles/{}.json'.format(active_user), 'r') as userjson: userData = json.load(userjson) if (len(userData["Routines"]) > 0): routines = userData["Routines"] else: routines = [] except FileNotFoundError: wx.MessageBox('No Routines were found.', 'Info', wx.OK | wx.ICON_INFORMATION) app = wx.App() frame = MainWindow.MainWindow(None, "MyTrainer", active_user, routines) app.MainLoop()
def menu(self, MainWindow): # TODO show create an instance of menu here ? self.menu = QtWidgets.QMainWindow() self.ui = menu.Ui_MainWindow() self.ui.setupUi(self.menu) self.menu.show() MainWindow.close()
def main(): # Again, this is boilerplate, it's going to be the same on # almost every app you write app = QtGui.QApplication(sys.argv) window = MainWindow.MainWindow() window.show() # It's exec_ because exec is a reserved word in Python sys.exit(app.exec_())
def create_frame_dictionary(self): frame = mw.MainWindow(self.container, self, self.pdb) frame.grid(row=0, column=0, sticky="nsew") self.frames[mw.MainWindow] = frame frame = aw.AddOrEditUserWindow(self.container, self, self.pdb) frame.grid(row=0, column=0, sticky="nsew") self.frames[aw.AddOrEditUserWindow] = frame
def main(f_path, qt): app = QApplication(sys.argv) mw = MainWindow.MainWindow(f_path, qt) mw.show() app.exec_() mw.end_program() time.sleep(0.5)
def open_map (self, map, imported=False): win = MainWindow.LabyrinthWindow (map.filename, imported) win.connect ("title-changed", self.map_title_cb) win.connect ("window_closed", self.remove_map_cb) win.connect ("file_saved", self.file_save_cb) win.show () map.window = win return (MapList.index(map), win)
def GreenFon(self): self.ButtonColor5 = '#336666' with open("ButtonColor.txt", "w") as colorfile: colorfile.write(self.ButtonColor5) MainWindow.MainWindow().update()
def check_details(self): password_error = True username_error = True if self.username_lineedit.text() == self.user_name: #print("Username Checked") username_error = False if self.password_lineedit.text() == self.password: #print("Password Checked") password_error = False if not username_error and not password_error: window1 = MainWindow() window1.show() window1.raise_() else: self.error = QErrorMessage() self.error.showMessage("Error P001 - Incorrect Username and/or Password","Password Error") self.error.setWindowTitle("Username / Password Error")
def switchToOrthographicMode(): # Set up orthographic projection for drawing to screen (width, height) = MainWindow.get().size() glDisable(GL_DEPTH_TEST) glDisable(GL_LIGHTING) glMatrixMode(GL_PROJECTION) glPushMatrix() glLoadIdentity() gluOrtho2D(0.0, 1.0 * width, 0.0, 1.0 * height) glMatrixMode(GL_MODELVIEW) glPushMatrix() glLoadIdentity()
def main(): app = QApplication(sys.argv) window = MainWindow() log = file(sys.argv[1]).readlines() log = [x.rstrip() for x in log] window.setLog(log) window.setWindowTitle(sys.argv[1]) window.show() app.exec_()
def __init__(self): self.config = Configuration("./resources/prueba.xml") self.prefDialog = PreferencesDialog(self.config) self.faceSign = FaceSignature() self.captureDevice= CaptureDevice(self) self.MW = MainWindow(self) self.setCaptureDevice() self.MW.mainWindow.show() gtk.main()
def run(): """This method runs the boxfish application.""" signal.signal(signal.SIGINT, signal.SIG_DFL) # May be called on some systems, not on others and the latter # will crash without it if GLUT stuff is used. #glutInit(sys.argv) app = QApplication(sys.argv) #app.setStyle('plastique') bf = MainWindow() # Open runs based on command line arguments if len(sys.argv) > 1: bf.openRun(*sys.argv[1:]) bf.show() bf.raise_() sys.exit(app.exec_())
from PyQt4.QtSql import* from MainWindow import * from AddPatient import * import sys class MainWindow(QMainWindow): def __init__(self): super().__init__() self.setWindowTitle("Appointment System") self.menu_bar = QMenuBar() self.add_menu = self.menu_bar.addMenu("Add") self.add_menu.addAction("Add Patient") self.browse_menu = self.menu_bar.addMenu("Browse") self.browse_menu.addAction("Patients") self.setMenuBar(self.menu_bar) if __name__ == "__main__": application = QApplication(sys.argv) window = MainWindow() window.show() window.raise_() application.exec_()
#!/usr/bin/python import MainWindow import AirportsList # reading list of airports from the file airportstuple = AirportsList.readairportslist() # running program main window (GUI) MainWindow.open(airportstuple)
glFogf(GL_FOG_START, self.lightEnv.fogStart()) glFogf(GL_FOG_END, self.lightEnv.fogEnd()) glEnable(GL_FOG) else: glDisable(GL_FOG) def resize(self, (width, height)): glViewport(0, 0, width, height) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(45, 1.0*width/height, 0.2, 100.0) glMatrixMode(GL_MODELVIEW) tdbWidth = 250 tdbHeight = 8 tdbY = MainWindow.get().size()[1] - tdbHeight * 20 - 30 self._topTextDisplayer.setPosn((width/2, 10)) self._topTextDisplayer.invalidate() self._centeredTextDisplayer.setPosn((width/2, height/2)) self._centeredTextDisplayer.invalidate() self.textDisplayerBox.setPosn((10, tdbY)) self.textDisplayerBox.invalidate() self._topMenu.setPosn((290, tdbY)) self._topMenu.invalidate() # self._specialMenu.setPosn((420, tdbY)) # self._specialMenu.invalidate() self.cursorPosnDisplayer.invalidate() def setCursorPosn(self, x, y): self.cursor.setPosn(x, y)
self.setupUi(self) #SLOTS MainWindow# def administra_complex_1(self): #deixem per mes tard print "Executant commanda: administra_complex_1() " administra = Dialog(self) ok = administra.exec_() def administra_complex_2(self): #deixem per mes tard print "Executant commanda: administra_complex_2() " def administra_complex_3(self): #deixem per mes tard print "Executant commanda: administra_complex_3() " if __name__ == "__main__": global app app = QtGui.QApplication(sys.argv) finestra = MainWindow() finestra.show() sys.exit(app.exec_())
def OnInit(self): self.main = MainWindow.create(None) self.main.Show() self.SetTopWindow(self.main) return True
def back(self): application = QApplication(sys.argv) main_window = MainWindow() main_window.show()
# coding=latin-1 from MainWindow import * app = QApplication(sys.argv) janela = MainWindow() janela.show() app.exec_()
def __init__(self, m): global _gui _gui = self self.lightEnv = Light.Environment() self.lightEnv.addLight(Light.White(brightness=0.5, position=[20, 15, 100])) self.lightEnv.setFog(color=[0.4,0.4,0.5], start=10.0, end=30.0) self.setLighting() self.m = m for j in xrange(0, m.height): for i in xrange(0, m.width): self.compileMapSquareList(m.squares[i][j]) self._highlightAlpha = 1.0 self.camera = Camera.Camera() tdbWidth = 250 tdbHeight = 8 tdbY = MainWindow.get().size()[1] - tdbHeight * 20 - 30 center = (MainWindow.get().size()[0]/2,MainWindow.get().size()[1]/2) self.cursor = MapEditorCursor.MapEditorCursor(m) self._topMenu = MapEditorSprite.TopMenu((290, tdbY)) self._tagMenu = MapEditorSprite.TagMenu((500, tdbY)) self._tagMenu.setOptions(self.m.tags.keys()) self._tagMenu.setShowing(False) self._chooseTagMenu = MapEditorSprite.TagMenu2((500, tdbY)) self._chooseTagMenu.setOptions(self.m.tags.keys()) self._chooseTagMenu.setShowing(False) self._addTagDialog = MapEditorSprite.AddTagDialog((50, 50), MainWindow.get().size()[0] - 130) self._editTagDialog = MapEditorSprite.EditTagDialog((50, 50), MainWindow.get().size()[0] - 130) self._saveDialog = MapEditorSprite.SaveDialog((50, 50), MainWindow.get().size()[0] - 130) self._tileInfoDisplayer = MapEditorSprite.TileInfoDisplayer((50, 50), MainWindow.get().size()[0] - 130) self.delegates = {} self.delegates['cursor'] = self.cursor self.delegates['topMenu'] = self._topMenu self.delegates['setTag'] = self._tagMenu self.delegates['addTag'] = self._addTagDialog self.delegates['editTag'] = self._editTagDialog self.delegates['chooseTag'] = self._chooseTagMenu self.delegates['save'] = self._saveDialog self.delegates['tileInfo'] = self._tileInfoDisplayer self.activeDelegate = self.delegates['cursor'] self.cursorPosnDisplayer = Sprite.CursorPosnDisplayer(self.cursor) self.tileTextureDisplayer = MapEditorSprite.TileTextureDisplayer(self.cursor) self.tileColorDisplayer = MapEditorSprite.TileColorDisplayer(self.cursor) self.tileTagDisplayer = MapEditorSprite.TileTagDisplayer(self.cursor) self.firstHeightDisplayer = MapEditorSprite.FirstHeightDisplayer(self.cursor,self.camera) self.secondHeightDisplayer = MapEditorSprite.SecondHeightDisplayer(self.cursor,self.camera) self.thirdHeightDisplayer = MapEditorSprite.ThirdHeightDisplayer(self.cursor,self.camera) self.textDisplayerBox = Sprite.TextDisplayerBox([ self.tileTagDisplayer, self.tileTextureDisplayer, self.tileColorDisplayer, self.firstHeightDisplayer, self.secondHeightDisplayer, self.thirdHeightDisplayer ], (10, tdbY) , tdbWidth) # self._specialMenu = Sprite.SpecialMenu((420, tdbY)) self._centeredTextDisplayer = Sprite.TextDisplayer() self._centeredTextDisplayer.setCenterX(True) self._centeredTextDisplayer.setCenterY(True) self._centeredTextDisplayer.setFont(Resources.font(size=36, bold=True)) self._centeredTextDisplayer.setPosn(center) self._centeredTextDisplayer.setBorder(True) self._centeredTextDisplayer.setEnabled(False) self._topTextDisplayer = Sprite.TextDisplayer() self._topTextDisplayer.setCenterX(True) self._topTextDisplayer.setCenterY(False) self._topTextDisplayer.setFont(Resources.font(size=16, bold=True)) self._topTextDisplayer.setPosn((MainWindow.get().size()[0]/2, 10)) self._topTextDisplayer.setBorder(True) self._topTextDisplayer.setEnabled(False) self.highlights = {} self.cursorHighlightAlpha = 0.0 self.highlightEnabled = False self._activeSquare = None self.normalObjects = [self.cursor] self.fgObjects = [self.cursorPosnDisplayer, self.textDisplayerBox, self._addTagDialog, self._saveDialog, self._tileInfoDisplayer, self._editTagDialog, self._topMenu, self._tagMenu, self._chooseTagMenu, # self._specialMenu, self._centeredTextDisplayer, self._topTextDisplayer] self.gameObjects = [] self.gameObjects.extend(self.normalObjects) self.gameObjects.extend(self.fgObjects) # Sound.playMusic(scenario.music()) # (clearr, clearg, clearb) = self.lightEnv.skyColor() # glClearColor(clearr, clearg, clearb, 0.0) glClearColor(0.8, 0.8, 0.85, 0.0) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) self.scrollTo((self.m.width/2.0, self.m.height/2.0))
import sys import json #open up a store with open(sys.argv[1], mode="rb") as file: info_json = json.load(file) storeType = "MFS" try: if info_json["metadata"]["store_type"] == "SFS": cs = cinema_store.SingleFileStore(sys.argv[1]) else: raise TypeError except(TypeError,KeyError): cs = cinema_store.FileStore(sys.argv[1]) cs.load() # Show it in Qt app = QApplication(sys.argv) # set up UI from MainWindow import * mainWindow = MainWindow() mainWindow.setStore(cs) mainWindow.show() # Enter Qt application main loop app.exec_() sys.exit()
def OnInit(self): wx.InitAllImageHandlers() self.main = MainWindow.create(None) self.main.Show() self.SetTopWindow(self.main) return True
from PyQt4.QtGui import QApplication from MainWindow import * from SystemTryIcon import * if __name__ == "__main__": import sys app = QApplication(sys.argv) main_win = MainWindow() systry = ApplicationSystemTry(main_win) systry.show() main_win.show() sys.exit(app.exec_())
import MainWindow import rpc_server # 调用windows命令taskkill杀死程序 def kill_exe(exe): command = 'taskkill /F /IM %s' % exe os.system(command) # 启动一个线程,运行rpc服务器 def run_rpc_server1(): t1 = threading.Thread(target=rpc_server.main) t1.setDaemon(True) t1.start() return t1 #启动一个进程运行rpc服务器 def run_rpc_server2(): subprocess.Popen("python rpc_server.py") if __name__ =='__main__': # 启动一个线程,运行rpc服务器 t1 = run_rpc_server1() # 启动一个进程运行rpc服务器 # run_rpc_server2() # 启动主界面 MainWindow.run() #杀死所有的python进程 kill_exe('python.exe')
#!/usr/bin/python # Import PySide classes import sys from PySide.QtCore import * from PySide.QtGui import * from PySide.QtUiTools import * from PySide import QtXml # import json import json as simplejson # import Python Image Library import PIL.ImageFile # Import cinema IO import IO.cinema_store # Show it in Qt app = QApplication(sys.argv) # set up UI from MainWindow import * mainWindow = MainWindow() mainWindow.show() # Enter Qt application main loop app.exec_() sys.exit()
# along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # ############################################################################## from Koo.Common import Localization Localization.initializeTranslations() # Load this after localization as these modules depend on it from Koo.Common import Notifier, Common # Declare notifier handlers for the whole application Notifier.errorHandler = Common.error Notifier.warningHandler = Common.warning Notifier.concurrencyErrorHandler = Common.concurrencyError from PyQt4.QtGui import * from PyQt4.QtCore import * import sys from MainWindow import * app = QApplication( sys.argv ) Localization.initializeQtTranslations() window = MainWindow() window.show() app.exec_()
def main(): app = QtGui.QApplication(sys.argv) w = MainWindow() w.setWindowTitle('Universe Editor') w.showMaximized() sys.exit(app.exec_())
def main(argv): app = QtGui.QApplication(argv) mainwindow = MainWindow() mainwindow.show() sys.exit(app.exec_())
def do_activate(self): win = MainWindow(self) win.show_all()
glPushMatrix() glTranslate(0.0, 0.0, z) glBegin(GL_TRIANGLE_FAN) glVertex3f( 0.0, 0.0, 0.0) glVertex3f( 0.5, 0.5, cornerHeights[1] * Z_HEIGHT) glVertex3f(-0.5, 0.5, cornerHeights[0] * Z_HEIGHT) glVertex3f(-0.5, -0.5, cornerHeights[2] * Z_HEIGHT) glVertex3f( 0.5, -0.5, cornerHeights[3] * Z_HEIGHT) glVertex3f( 0.5, 0.5, cornerHeights[1] * Z_HEIGHT) glEnd() glPopMatrix() glEnable(GL_LIGHTING) def drawAt((posx, posy), texture, image): (width, height) = MainWindow.get().size() dx = image.get_width() dy = image.get_height() switchToOrthographicMode() glTranslate(posx, height-posy, 0.0) makeRect(texture, dx, -dy) switchFromOrthographicMode() def switchToOrthographicMode(): # Set up orthographic projection for drawing to screen (width, height) = MainWindow.get().size() glDisable(GL_DEPTH_TEST) glDisable(GL_LIGHTING) glMatrixMode(GL_PROJECTION) glPushMatrix() glLoadIdentity()