本文整理匯總了Python中pelita.simplesetup.SimpleServer.run_tk方法的典型用法代碼示例。如果您正苦於以下問題:Python SimpleServer.run_tk方法的具體用法?Python SimpleServer.run_tk怎麽用?Python SimpleServer.run_tk使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pelita.simplesetup.SimpleServer
的用法示例。
在下文中一共展示了SimpleServer.run_tk方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: SimpleServer
# 需要導入模塊: from pelita.simplesetup import SimpleServer [as 別名]
# 或者: from pelita.simplesetup.SimpleServer import run_tk [as 別名]
# -*- coding: utf-8 -*-
"""
We start a server using the SimpleServer class and a layout
given by the specified layout file.
"""
from pelita.simplesetup import SimpleServer
server = SimpleServer(layoutfile="layouts/02.layout")
# For more control, we could also define a game with 8 Bots,
# run 10000 rounds and want to receive connections on port
#
# server = SimpleServer(layoutfile="layouts/02.layout", players=8, rounds=10000, port=61009)
# Now we run it with a Tk interface.
# This will only ever return if interrupted or if Tk is closed.
server.run_tk()