question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: Long texts length is not matching output area in Jupyter

See original GitHub issue

Description

Currently, on using long texts with animations in Jupyter results in output wrapping in next line. Fix for this would be to give it a fixed layout width or try and get the width of display area while creating frames.

System settings

  • Operating System: Mac OS
  • Terminal in use: NA
  • Python version: 2.7.14
  • Halo version: HEAD
  • pip freeze output: NA

Error

Output wraps in display area for Jupyter notebook when long texts are used.

Expected behaviour

Output should take width of display area before creating frames.

Steps to recreate

longtext

People to notify

@JungWinter @ManrajGrover

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JungWintercommented, May 17, 2018

I checked it occurred because of wrong get_terminal_size(). In jupyter, width of Output widget is not related with terminal size. But in HaloNotebook._get_text(), it use get_terminal_columns() via backports.shutil_get_terminal_size.get_terminal_size().

backports.shutil_get_terminal_size.get_terminal_size() decide terminal width using columns = int(os.environ["COLUMNS"]). But jupyter widget is independent with terminal size and related with HMTL/CSS. So I’m searching to get current jupyter cell’s width and how to convert to ascii terminal size like 80, 120, etc.

0reactions
ajjayymahatocommented, Oct 11, 2022

If this issue is open can you please assign it to me so that I can work on it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jupyter Notebook is not showing the output of any code ...
Hello, I am new to python. When I use Jupyter Notebook the code inside the cells won't execute and I get these empty...
Read more >
IPython Notebook output cell is truncating contents of my list
Show activity on this post. just use the print command instead of calling the list directly. Like print mylist . It would not...
Read more >
Jupyter Notebook Users Manual.ipynb - Bryn Mawr College
Raw Cells, unlike all other Jupyter Notebook cells, have no input-output distinction. This means that Raw Cells cannot be rendered into anything other...
Read more >
The Notebook file format — nbformat 5.7 documentation
The Notebook file format#. The official Jupyter Notebook format is defined with this JSON schema, which is used by Jupyter tools to validate...
Read more >
Python Tutorial - File and Text Processing
File Input/Output. File Input/Ouput (IO) requires 3 steps: Open the file for read or write or both. Read/Write data. Close the file to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found