mirror of
https://github.com/Dinnerbone/mcstatus.git
synced 2026-04-06 12:01:24 +08:00
Set usage to python block
This commit is contained in:
@@ -6,6 +6,7 @@ mcstatus provides an easy way to query Minecraft servers for any information the
|
|||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
```python
|
||||||
from mcstatus import MinecraftServer
|
from mcstatus import MinecraftServer
|
||||||
|
|
||||||
server = MinecraftServer("localhost", 25565)
|
server = MinecraftServer("localhost", 25565)
|
||||||
@@ -18,6 +19,7 @@ Usage
|
|||||||
# It may give more information than a ping, such as a full player list or mod information.
|
# It may give more information than a ping, such as a full player list or mod information.
|
||||||
query = query.query_server()
|
query = query.query_server()
|
||||||
print("The server has the following players online: " % (string.join(query.players.names, ", ")))
|
print("The server has the following players online: " % (string.join(query.players.names, ", ")))
|
||||||
|
```
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
|
|||||||
Reference in New Issue
Block a user