Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display Jupyter Notebook output text and images in order #2676

Closed
DleanJeans opened this issue Nov 22, 2019 · 5 comments
Closed

Display Jupyter Notebook output text and images in order #2676

DleanJeans opened this issue Nov 22, 2019 · 5 comments
Assignees

Comments

@DleanJeans
Copy link

Feature: Notebook Editor, Interactive Window, Python Editor cells

Sent here from microsoft/vscode#85311

Description

Copypasted

Let me succinctly describe this with code and outputs.

Example Code:

from IPython.display import display

for name, image in images_with_name.items():
  print(name)
  display(image)

Google Colab:

Name1
[Image1]
Name2
[Image2]
Name3
[Image3]

VS Code:

Name1
Name2
Name3
---------
[Image1]
[Image2]
[Image3]

Can we make it output like Google Colab?

I moved from Google Colab to use Jupyter on my local machine and it's kinda weird to see VS Code display texts and images in 2 different views (even with scrollbar). It's still readable with a few pairs but things get out of hands when it's a long list.

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer

@jmew
Copy link
Contributor

jmew commented Nov 22, 2019

@DleanJeans Thanks for the feedback. Can confirm that JupyterLab also does the same thing Colab does.

@DleanJeans
Copy link
Author

Also missing support for printing with colors, and \r for overriding/updating previous line.

Do I open new issues or maybe one to track them all?

@DleanJeans
Copy link
Author

There seems to be a separation between print and display output.
If display is used to output both text and images then they would be in order:

for name, image in images_with_name.items():
  # print(name)
  display(name)
  display(image)

@rchiodo
Copy link
Contributor

rchiodo commented Dec 2, 2019

@DleanJeans please open a new issue for the other two problems you found. Thanks.

@rchiodo rchiodo self-assigned this Dec 10, 2019
@IanMatthewHuff IanMatthewHuff self-assigned this Dec 13, 2019
@IanMatthewHuff
Copy link
Member

Validated. With print() and display(Image()) statements interleaved in a loop they now show up on the output in order.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 20, 2019
@microsoft microsoft unlocked this conversation Nov 14, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants