9/9/2023 0 Comments Supremacy 1914 instaling![]() Testing is done with PyTest, to run the tests use the command pytest. Other information about functions and exceptions can be found on the wiki. url = str ( exception ) result = supremacy. players () except ServerChangeError as exception : # update the url in the Supremacy instance supremacy. ![]() from supremacy1914_wrapper import Supremacy, ServerChangeError # Create a Supremacy instance using game id and server url supremacy = Supremacy ( "2502620", "" ) # Send a request and except server change error try : result = supremacy. Make sure to use a try except because the server changes over time. When you have to server url from the game you can pass it into the Supremacy constructor. from supremacy1914_wrapper import Supremacy, ServerChangeError # Create a Supremacy instance using game id supremacy = Supremacy ( "2502620" ) # Send a request and except server change error try : result = supremacy. If you don't have the server url you can make a Supremacy instance without the url parameter, wrap it in a try except to get the server url. ![]() It's advised to store the server url for the game you want to request. Install $ pip install supremacy1914-wrapper You'll only need to supply the server URL and the game_id before you'll be able to get data. This wrapper support API data as far as known and is intended to be easy to use. ![]() This unofficial API wrapper is an implementation of the Supremacy 1914 API. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |