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


Python State.start方法代码示例

本文整理汇总了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)
开发者ID:CodeSkool,项目名称:SimpleGUI2Pygame,代码行数:6,代码来源:React.py

示例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()
开发者ID:kms70847,项目名称:Tic-Tac-Toe,代码行数:33,代码来源:main.py


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