本文整理汇总了Python中Client.stop方法的典型用法代码示例。如果您正苦于以下问题:Python Client.stop方法的具体用法?Python Client.stop怎么用?Python Client.stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client.stop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: raw_input
# 需要导入模块: import Client [as 别名]
# 或者: from Client import stop [as 别名]
# Insert your key here
c.KEY = "g2lVRjJN96svcwTYPG8K0MmUfdQq6Xg1"
# Tell the client to use this function to decide the next move.
# This function is defined above.
c.decide_move = dummy
# Connect to the game server
if c.connect():
# If we successfully connected, start playing
print 'Connected'
# Tell the client to start listening for maps
c.start()
# Wait until the user presses a key
raw_input('Press any key to quit...')
# Tell the client to stop listening for maps
c.stop()
# Wait for the client to finish its last request
c.join()
# Disconnect from the server
c.disconnect()
else:
# If we didn't successfully connected, exit
print 'Could not connect'