本文整理汇总了Python中state.State.start方法的典型用法代码示例。如果您正苦于以下问题:Python State.start方法的具体用法?Python State.start怎么用?Python State.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类state.State
的用法示例。
在下文中一共展示了State.start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: start
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import start [as 别名]
def start(self):
if self.replace == None:
TimerEvents().start(self.eventid, self.countdown)
State.start(self)
示例2: open
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import start [as 别名]
return
file = open(filename, "w")
file.write(serialize(self.state))
file.close()
def loadPressed(self):
filetypes = [('ttt files', '.ttt'), ('all files', '.*')]
filename = tkFileDialog.askopenfilename(filetypes=filetypes)
if filename == "":
return
data = open(filename).read()
state = deserialize(data)
self.startGame(state)
def exitPressed(self):
self.root.quit()
def hintPressed(self):
#possible enhancement: put this in a seperate thread so it doesn't lock up the interface.
#it only has a noticeable delay for the very first move of the game, however, so NBD
(x,y), _ = getBestMove(self.state, 1,2)
self.view.throb(x,y)
def aboutPressed(self):
tkMessageBox.showinfo("About", "Written by: Kevin Smiley\nThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.")
def idle(self):
self.canvas.after(1000/600, self.idle)
self.state.checkDeferredCalls()
s = State()
t = TopLevelWindow(s)
s.start()
t.start()