From ed792b4642dc27f66257e697ac3cf5afe9addb5e Mon Sep 17 00:00:00 2001 From: Peter Urda Date: Tue, 16 Sep 2014 12:40:31 -0700 Subject: [PATCH] Set `usage` to python block --- README.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index f2727c2..88b3aa6 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,20 @@ mcstatus provides an easy way to query Minecraft servers for any information the Usage ----- - from mcstatus import MinecraftServer - - server = MinecraftServer("localhost", 25565) - - # 'ping' is supported by all Minecraft servers that are version 1.7 or higher. - status = server.ping_server() - print("The server has %d players" % (status.players.online)) - - # 'query' has to be enabled in a servers' server.properties file. - # It may give more information than a ping, such as a full player list or mod information. - query = query.query_server() - print("The server has the following players online: " % (string.join(query.players.names, ", "))) +```python +from mcstatus import MinecraftServer + +server = MinecraftServer("localhost", 25565) + +# 'ping' is supported by all Minecraft servers that are version 1.7 or higher. +status = server.ping_server() +print("The server has %d players" % (status.players.online)) + +# 'query' has to be enabled in a servers' server.properties file. +# It may give more information than a ping, such as a full player list or mod information. +query = query.query_server() +print("The server has the following players online: " % (string.join(query.players.names, ", "))) +``` Installation ------------ @@ -31,4 +33,4 @@ Alternatively, just clone this repo! License ------- -mcstatus is licensed under Apache 2.0. \ No newline at end of file +mcstatus is licensed under Apache 2.0.