当前位置: 首页>>代码示例>>Python>>正文


Python Gui.start方法代码示例

本文整理汇总了Python中gui.Gui.start方法的典型用法代码示例。如果您正苦于以下问题:Python Gui.start方法的具体用法?Python Gui.start怎么用?Python Gui.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gui.Gui的用法示例。


在下文中一共展示了Gui.start方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from gui import Gui [as 别名]
# 或者: from gui.Gui import start [as 别名]
def main():
    print 'Simulation started.'

    # Test initial table
    table_data = read_datasheet('../mdata/sample_table.data')
    shot_sequence = read_player_data('../mdata/shots.data', table_data)
    tbl = Table(table_data, shot_sequence)

    spawn(tbl.loop)

    gui = Gui(tbl, 350, 700)
    gui.start()
开发者ID:manna422,项目名称:pool_sim,代码行数:14,代码来源:main.py

示例2: LogViewer

# 需要导入模块: from gui import Gui [as 别名]
# 或者: from gui.Gui import start [as 别名]
class LogViewer(QtGui.QMainWindow):

    def __init__(self, args, **kwargs):
        super().__init__()

        analyzers = dict()

        self.analyzers = []
        self.files = []
        self.indices = []

        self.gui = Gui(**kwargs)
        self.gui.initGui(self)
        self.gui.addEditors(len(args))

        for i in range(len(args)):
            arg = args[i]
            arg = arg.split('@')
            input = arg[0]

            hostname = re.compile("^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?:[0-9]+$", re.IGNORECASE)
            if hostname.match(input):
                host, port = input.split(':')
                port = int(port)
                sock = socket.socket()
                sock.connect((host, port))
                self.files += [sock.makefile(mode="r")]
            else:
                self.files += [open(input, mode="r")]


            if len(arg) > 1:
                analyzer_name = arg[1]
            else:
                analyzer_name = DEFAULT_ANALYZER
            if len(arg) > 2:
                arg = '@'.join(arg[2:])
            else:
                arg = DEFAULT_ANALYZER_ARGS

            print("Analyzing %s by %s(%s)" %(input, analyzer_name, arg))

            if not analyzer_name in analyzers:
                package_name = "analyzers."+analyzer_name.lower()
                class_name = analyzer_name.capitalize()+"Analyzer"
                analyzers[analyzer_name] = getattr(__import__(package_name, fromlist=[class_name]), class_name)

            self.analyzers += [analyzers[analyzer_name](self.files[i].buffer, lambda time, value, i=i: self.gui.add(i, time, value), arg)]

        self.show()
        self.gui.start()
开发者ID:7Robot-Soft,项目名称:logviewer,代码行数:53,代码来源:logviewer.py

示例3: main

# 需要导入模块: from gui import Gui [as 别名]
# 或者: from gui.Gui import start [as 别名]
def main():
    global only_with_photos
    gui = Gui()
    gui.start()
    only_with_photos = Gui.only_with_photos.get()
    while True:
        try:
            print "Start Mailer"
            mailer = Mailer(only_with_photos)
            mailer.start()
            print "Finished Successfully"
        except Exception:
            print "Something went wrong... Restarting..."
            mailer.close_mailer()
            time.sleep(10)
        else:
            print "Finished without exceptions"
            break
开发者ID:petryshend,项目名称:flpy,代码行数:20,代码来源:in.py

示例4: Gui

# 需要导入模块: from gui import Gui [as 别名]
# 或者: from gui.Gui import start [as 别名]
from gui import Gui

g = Gui()
g.start()
开发者ID:andrewgodwin,项目名称:airport-mogul,代码行数:6,代码来源:game.py

示例5: App

# 需要导入模块: from gui import Gui [as 别名]
# 或者: from gui.Gui import start [as 别名]
class App(object):
	"""Manage application controllers, respond to user input, run master loop.

	This class wraps together the various components of the application. It is
	the application entry point. On startup, it creates an instance of each
	controller. The run() method starts each controller and runs the master loop
	until the user quits.

	Settings:
		experimentName: used to label the output directory and in output metadata
		keyBindings: a dictionary where the keys are 'quit', 'toggleStimulator',
			and 'triggerStimulator', and the values are one-character strings
			representing the button that triggers the action specified by the key
		outputRootDir: directory where the folder containing trial data will be
			created
	"""

	def __init__(self, **kwargs):
		"""Initialize the keycode bindings and all controllers, create output dir."""
		settings = {
			'experimentName' : 'someNameHere',
			'outputRootDir' : os.path.normpath(os.path.expanduser("~/kauferdata")),
			'keyBindings' : {
				'quit' : 'q',
				'toggleStimulator' : 't',
				'triggerStimulator' : 's'
				},
			'audio' : {},
			'gui' : {},
			'stimulator' : { 'activeProtocolName' : 'nucleusAccumbensExample' },
			'tracker' : {},
			'videoIn' : {},
			'videoOut' : {},
			'writer' : {},
			}
		settings.update(kwargs)
		trialDir = "{0}_{1}_{2}".format(time.strftime("%y%m%d%H%M%S"),
				settings['experimentName'], settings['stimulator']['activeProtocolName'])
		settings['outputDataDir'] = os.path.join(settings['outputRootDir'], trialDir)
		self.keyBindings = settings['keyBindings']
		self.keycodeBindings = {k: getattr(opencvgui.keycodes, v)
				for k,v in self.keyBindings.items() }
		os.makedirs(os.path.join(settings['outputDataDir'], 'audio'))
		self.writeExperimentData(settings)
		for x in ['audio', 'videoOut', 'writer']:
			kwargs[x] = {} if not kwargs.has_key(x) else kwargs[x]
			kwargs[x]['outputDataDir'] = settings['outputDataDir']

		# gui and writer both need a reference to the app instance because they
		# draw on the state of so many other controllers
		self.audio = Audio(**settings['audio'])
		self.gui = Gui(self, **settings['gui'])
		self.stimulator = Stimulator(**settings['stimulator'])
		self.tracker = Tracker(**settings['tracker'])
		self.videoIn = VideoIn(**settings['videoIn'])
		self.videoOut = VideoOut(**settings['videoOut'])
		self.writer = Writer(self, **settings['writer'])

	def run(self):
		"""Respond to user input and run the master application loop.

		This method has three basic sections. Before the loop starts, the start()
		method is called on all controllers. The central loop calls update() on
		each controller until it is terminated by a user-issued quit keystroke.
		Keystrokes are listened for at the start of each loop iteration.
		"""
		self.printKeybindings()
		self.startTime = self.lastTime = time.clock()
		self.audio.start()
		self.gui.start()
		self.stimulator.start()
		self.tracker.start()
		self.videoIn.start()
		self.videoOut.start()
		self.writer.start()

		while True:

			# respond to user input
			lastKeyStroke = cv2.waitKey(20)  # 20 is the number of ms to wait for key
			if lastKeyStroke != -1: # -1 means there was no keystroke
				if lastKeyStroke == self.keycodeBindings['quit']:
					break
				if lastKeyStroke == self.keycodeBindings['triggerStimulator']:
					self.stimulator.trigger()
				if lastKeyStroke == self.keycodeBindings['toggleStimulator']:
					self.stimulator.toggle()

			# update state
			self.currTime = time.clock()
			self.totalTimeElapsed = self.currTime - self.startTime
			self.audio.update()
			self.videoIn.update()
			self.tracker.update(self.videoIn, self.currTime)
			self.stimulator.update(self.currTime, self.tracker)
			self.videoOut.update(self.videoIn, self.tracker, self.stimulator)
			self.gui.update()
			self.lastTime = self.currTime
			self.writer.update()

#.........这里部分代码省略.........
开发者ID:smackesey,项目名称:kaufer_prosocial,代码行数:103,代码来源:app.py

示例6: go

# 需要导入模块: from gui import Gui [as 别名]
# 或者: from gui.Gui import start [as 别名]
#!/usr/bin/env python3

from gui import Gui


def go():
    gui.setValue(0, 0, 1)
    gui.setValue(0, 1, 2)
    gui.setValue(0, 2, 7)
    gui.setValue(0, 3, None)
    gui.setValue(0, 4, 9)
    gui.setColor(0, 0, "green")
    gui.setColor(0, 1, "green")
    gui.setColor(0, 2, "green")
    gui.setColor(0, 3, "green")
    gui.setColor(0, 4, "green")

    gui.setValue(1, 0, 1)
    gui.setValue(1, 1, 4)
    gui.setValue(1, 2, 8)
    gui.setValue(1, 3, "")
    gui.setValue(1, 4, 9)


gui = Gui()
gui.setCallBack(go)
gui.start()
开发者ID:Vampouille,项目名称:pySudoku,代码行数:29,代码来源:example.py

示例7:

# 需要导入模块: from gui import Gui [as 别名]
# 或者: from gui.Gui import start [as 别名]

columnsample = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]

Gui.setcolumn(win, columnsample, 6, Gui.Label, 1)  # Fill a whole column each array num is a location on the column


'''
VVVV Edit individual boxes VVVVV
'''


Gui.changeentry(win, 2, 2, "Edit indv. item", Gui.Label)  # edit individual items

Gui.changeentry(win, 4, 3, "test button", Gui.Button, True, TESTBUTTON)  # Test button on the grid


'''
VVVV RUN THE ABOVE CODE FOREVER
'''


Gui.start()  # THIS CALL IS NECASSRY OR NO WINDOW WILL POP UP


'''
* Remember every change call needs to have the gui(root) with it
*
* Now after reading through this code try running it and see how they work with each other
'''
开发者ID:smerkousdavid,项目名称:InternetRFIDadminclient,代码行数:31,代码来源:Main.py

示例8: location

# 需要导入模块: from gui import Gui [as 别名]
# 或者: from gui.Gui import start [as 别名]
def location():
    print "location press"
    Gui.cleargrid(win)  # example how to clear grid

def name():
    print "name press"


def year():
    print "year press"
    Gui.deleteentry(win, 0, 0)

def date():
    print "date press"


count = 1
learnerarray = []
for i in range(0,5):
    learnerarray.append(LTSBackend(count).getData())
    count = count + 1

count = 1
for i in learnerarray:
    Gui.setrow(win,i,count)
    count +=1

t = threading.Thread(target=start)
t.start()
Gui.start()
开发者ID:smerkousdavid,项目名称:InternetRFIDadminclient,代码行数:32,代码来源:test.py


注:本文中的gui.Gui.start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。