What is the correct way to use `display(..., clear=True)` in PyCharm Jupyter Notebook?

I am running a loop (reinforcement learning) in a cell to receive visual information from the robot and control it. I want to continuously refresh the camera image of the robot in the loop. The Following codes run in Jupyter Lab/Notebook works as expected, in VSCode Jupyter works well also, but in PyCharm Notebook, it does not display the image. If I change the `clear=True` to `clear=False`, it display image well, but due to not clearing the output, a large number of images will quickly flood my notebook output space. So, what's the correct way to use `display(..., clear=True)` in PyCharm?

from IPython.display import display, clear_output
...
while True:
    image = ... # from robot camera
    display(image, clear=True)
    # The follows still not work as expected.
    # clear_output(wait=True)
    # display(image)

 

0
2 comments

Hi Huang, I have created a ticket here: https://youtrack.jetbrains.com/issue/PY-85700. Assigned developer will take a look.

Please follow the issue for updates, feel free to vote and comment, and let us know if you need any help. If you're not familiar with YouTrack, please see https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications

0

Thanks for your help!

0

Please sign in to leave a comment.