def main(): print('Hello!') u = cli.Parser() fname = file_manager.create_temp() p = file_manager.open_file('/usr/bin/gedit', fname) def check(): return (p.returncode is None) and (not u._forse_exit) def callback(): bma = updater.load_map(fname) if not bma is None: updater.update_right_map(bma) if cmap.equal_q(bma, updater.left_bmap): print('match :)', end=' ') else: print('no match :(', end=' ') print('tokens={}'.format(rules.count_tokens_from_file(fname))) file_manager.listen_file(fname, check, callback) window.show() u.reload() u._parse_loop() window.close() p.kill() print('Bye!')
def test_random_map(self): window.show() ma = window.create_random_colorized_map() window.update_map(ma, False) inp = input() window.close()
def main(): app = QApplication(sys.argv) QApplication.setQuitOnLastWindowClosed(False) window = Window() window.show() sys.exit(app.exec_())
def main(): a = QtGui.QApplication(sys.argv) window = IDEWindow() window.resize(960,540) window.show() sys.exit(a.exec_())
def test_open_file(self): window.show() fname = file_manager.create_temp() file = file_manager.open_file('/usr/bin/gedit', fname) def check(): return file.returncode is None def callback(): updater.update_window(fname) file_manager.listen_file_sync(fname, check, callback) window.close()
def accept(self): """Signal called when the button 'accept' is clicked.""" self.state.text = _('Connecting...') if not self._connect(): self.state.text = _('Connection failed.') return self.state.text = _('Connected. Loading GUI...') window = Window(self._eventsManager) window.show() window.commandEdit.setFocus() self._eventsManager.callbackConnectionClosed = window.connectionClosed self._eventsManager.defaultCallback = window.replyReceived self.hide()
def refresh(pixel_amount=64): commander_name = read_yaml("commander_name") start_system = read_yaml("start_system") end_system = read_yaml("end_system") print("commander_name:", commander_name) print("start_system:", start_system) print("end_system:", end_system) start_system_coordinates = get_system_coordinates(start_system) end_system_coordinates = get_system_coordinates(end_system) total_distance = distance(start_system_coordinates, end_system_coordinates) print("total_distance:", total_distance) distance_per_pixel = round(total_distance / pixel_amount, 2) print("distance_per_pixel:", distance_per_pixel) distance_left = distance(get_system_coordinates(get_commander_system(commander_name)), end_system_coordinates) print("distance_left:", distance_left) pixels_active = int(round(distance_left / distance_per_pixel, 0)) print("pixels_active:", pixels_active) progress = 100 - int(round(distance_left / (round(total_distance / 100)), 0)) print("progress: " + str(progress) + "%") import window window.show(progress) try: import Launchpad Launchpad.display(pixels_active) except: pass
#! /usr/bin/env python from PySide import QtGui import sys import window app = QtGui.QApplication(sys.argv) window = window.Window() window.show() ret = app.exec_() sys.exit(ret)
__author__ = 'Waldo' import sys from PyQt4 import QtGui, QtCore # Load prefs from file from preferences import loadPreferences, savePreferences loadPreferences() # Open up the window import window app = QtGui.QApplication(sys.argv) window.show() app.exec_() # Save preferences before exit savePreferences() sys.exit()
def sigint_handler(*args): """Handler for the SIGINT signal.""" global abortFlag sys.stderr.write('\r') abortFlag = True app.quit() abortFlag = False if __name__ == '__main__': rospy.init_node('swarm_contol_gui_node', anonymous=True) signal.signal(signal.SIGINT, sigint_handler) # run ros thread ros_t = QThread() ros_ = ROS_run() ros_.moveToThread(ros_t) ros_t.started.connect(ros_.run) ros_t.start() # run main app = QtWidgets.QApplication(sys.argv) # Новый экземпляр QApplication timer = QTimer() timer.start(500) # You may change this if you wish. timer.timeout.connect(lambda: None) # Let the interpreter run each 500 ms. window = WindowApp() # Создаём объект класса ExampleApp window.show() # Показываем окно sys.exit(app.exec_()) abortFlag = True