How to debug with python[solved]


#1

Hi :slight_smile: ,
as print() isn’t possible, and I just get errors if I want to set a breakpoint via import pdb; pdb.set_trace() is there any possibility to pause the game and inspect my variables?
Thank you very much :slight_smile:


#2

For local testing, you can write logging information to a file. If you’re building on the Python3 starter, logging should already be set up, e.g:

logging.info("Successfully created bot! My Player ID is {}.".format(game.my_id))


#3

Thank you very much, also Pythons logging documentation helped a lot, as I have never used it before :wink: