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.

print does not work as expected

See original GitHub issue

In branch 2.0. I run the example of docstring

from __future__ import unicode_literals
from prompt_toolkit import print
from prompt_toolkit.styles import Style

style = Style.from_dict({
    'hello': '#ff0066',
    'world': '#884444 italic',
})
fragments = [
('class:hello', 'Hello'),
('class:world', 'World'),
]
print(fragments, style=style)

output

[('class:hello', 'Hello'), ('class:world', 'World')]

But when I commented the two lines, it work

 66     # Merges values.
 67     def to_text(val):
 68         # if isinstance(val, list):
 69             # return to_formatted_text('{0}'.format(val))
 70         return to_formatted_text(val, auto_convert=True)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jonathanslenderscommented, Jun 16, 2018

Hi @benhoff, Sorry for the late reply. Right now, if you pass raw=True to patch_stdout, then it should work: https://github.com/jonathanslenders/python-prompt-toolkit/blob/master/prompt_toolkit/patch_stdout.py#L35

edit: I guess we can probably come up with a cleaner solution in the future.

0reactions
benhoffcommented, Jun 30, 2018

@jonathanslenders No worries, I got pulled off onto something else. Is there a good way to find out if this gets added/merged? Changelog? Documentation?

I’ll probably pull back onto using this in a couple of months so it’s no worries, just trying to figure out the best way to re-engage.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prolog print statement does not work as expected
Save this question. Show activity on this post. I was trying to define a functor and print each individual items of list in...
Read more >
13 Common Printer Problems and How to Fix Them
Sometimes your printer isn't the reason your jobs aren't printing. A stuck print job can logjam your queue, which prevents jobs from being ......
Read more >
webContents.print silent option not working as expected #14072
The print task should be sent without showing the system dialog, and it should print the html content. ... it is not doing...
Read more >
Troubleshooting - Epson
Printer stops printing unexpectedly. Head cleaning, ink charging, or ink drying is in progress. Check to see if the Pause light is flashing....
Read more >
window.print() function is not working as expected - CodeProject
As we can see in the code, the print() is being called after the call to open method. But in my browser IE11,...
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