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.

Answers being printed without newlines

See original GitHub issue

When I run howdoi, the answer is compressed into a single line.

Example in fish shell:

~ howdoi -c python json decode
import json j = json.loads('{"one" : "1", "two" : "2", "three" : "3"}') print j['two']

Example in bash:

chris@galactica:~$ howdoi -c python json decode
import json j = json.loads('{"one" : "1", "two" : "2", "three" : "3"}') print j['two']

I have tried add/removing various flags to see if that makes a difference, but the behaviour stays consistent:

~ howdoi python json decode
import json j = json.loads('{"one" : "1", "two" : "2", "three" : "3"}') print j['two']
~ howdoi -a python json decode
★  Answer from https://stackoverflow.com/questions/7771011/parse-json-in-python ★
Very simple:
import json j = json.loads('{"one" : "1", "two" : "2", "three" : "3"}') print j['two']

It is not just this specific query that acts this way, every question I enter behaves like this.

It seems that all the <pre> blocks in each answer are being compressed into a single line. In the case where an answer contains multiple <pre> blocks, they each appear on separate lines.

I think this is quite a recent development, but I can’t pin exactly when it started occurring. Let me know if there is any other useful information I can provide.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gleitzcommented, Feb 19, 2018

This is fixed in #187. Will release a new version shortly

0reactions
backwardspycommented, Feb 7, 2018

I just manually installed pyquery==1.3.0 in my howdoi venv and it fixed the issue for me too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to print without a newline or space - python
In Python 3, you can use the sep= and end= parameters of the print function: To not add a newline to the end...
Read more >
Python Print Without Newline: Step-by-Step Guide
Printing without a new line is simple in Python 3. In order to print without newline in Python, you need to add an...
Read more >
How to Print Without Newline in Python—A Simple Illustrated ...
Summary: To print without the newline character in Python 3, set the end argument in the print() function to the empty string or...
Read more >
Suppressing the automatic newline in Print
Print automatically generates a newline at the end of the expression that is being printed. How do you suppress this automatic newline?
Read more >
Output numbers, but WITHOUT a new line. - MATLAB Answers
So I have a for-loop, and at every iteration, I would like to display formatted text, along with some numbers. Normally one could...
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