Destaq
Destaq

Reputation: 795

How do I dynamically change an SVG output in a loop in Jupyter Notebook?

I am trying to make a chess simulation of two random bot players in Jupyter notebooks. To display an SVG image of the chess board, I can perform the following line: chess.svg.board(board = board, size = 300) This works if I display it in a standalone cell. However, if I try to display this board inside of a loop (so the players can have a display after each time they move), nothing happens. Could someone help me with this? Example below.

enter image description here

enter image description here

Upvotes: 0

Views: 496

Answers (1)

shutos
shutos

Reputation: 66

What luck! I was trying to visualize the board's dynamic state as well!

from IPython.display import display, Image

## Setup board here 
display(board)

Upvotes: 1

Related Questions