Dinnerbone / mcstatus

A Python class for checking the status of an enabled Minecraft server
http://dinnerbone.com/minecraft/tools/status/
1.11k stars 146 forks source link

Print status #119

Closed masterhacka closed 3 years ago

masterhacka commented 3 years ago

Hi there,

how can I make a python Script which prints out simply Online or Offline?

I can‘t figure it out..

kevinkjt2000 commented 3 years ago

This issue tracker is not here to teach you Python nor is it for us to write your code for you. You should be able to make a script that prints Online or Offline on your own... If a server is offline, mcstatus functions will raise an appropriate exception that your script can catch. If a server is online, there will be no exceptions, so your script could print "Online".

Hint: you'll want a try-catch block

Edit: If you need more of a hint than what I've given, you should seek help from a Python community. There's some popular ones on Discord if you spend a little time Googling. In my opinion, you probably need to spend more time learning from Python tutorials.