Skip to content

ipywidgets.Output always add newline to print, even when asked not to. #3990

Open
@lgautier

Description

@lgautier

Description

The Python function print() accepts a parameter end to specify what to add at the end of the print. The default is the new line character but this can be changed.

Reproduce

import ipywidgets
output = ipywidgets.Output()
display(output)

for i in range(10):
  with output:
    print(i, end=', ', flush=True)

Expected behavior

Printing on the same line as achieved when Output is not involved:

for i in range(10):
  print(i, end=', ', flush=True)

Context

  • ipywidgets version 7.7.1
  • Operating System and version: Colab
  • Browser and version: Firefox

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions