I want to print information to a gui and am using a public framework so my choices are limited. I would like to update a function in this page so I can print to the gui. Using the python print() function sends the output to the command line so I cannot use it. The current framework uses a TextElement object that prints to the gui, however it prints a mass of text to the gui if I continue to add variables and starts to look sloppy:
def render(self, model):
return ("Happy agents: " + str(model.happy)
return ("# Agents in majority: %s \
\n # Agents in minority: %s "
(model.countMajority,
model.countMinority ))
I added \n for line breaks but they are not adding new lines as I expected. I saw suggestions in stack overflow with tkinter but it is not a library in this framework. Do you have any suggestions how I can add a line break?
Thank you
# Agents in minority: %s" % (model.countMajority, model.countMinority)` – Tim Roberts Oct 31 '21 at 23:34
worked! That makes sense considering it is the interface but the code had no HTML formatting references, so I did not consider that option. – ithoughtso Oct 31 '21 at 23:56