Use 'format' instead of %

This commit is contained in:
Peter Urda
2014-09-16 13:15:45 -07:00
parent e7ac2f24f6
commit f07be86a20

View File

@@ -19,7 +19,7 @@ print("The server has {0} players".format(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 = server.query_server()
print("The server has the following players online: %s" % (", ".join(query.players.names)))
print("The server has the following players online: {0}".format(", ".join(query.players.names)))
```
Installation