bot icon indicating copy to clipboard operation
bot copied to clipboard

Remove line numbers from !eval command output.

Open lxnn opened this issue 3 years ago • 7 comments

In some cases they can make the output appear quite ugly. For example, here is the result of a command I ran yesterday (this is a printed Numpy array):

001 | [0.35319467 0.03863742 0.08606454 0.08990213 0.71744555 0.43287303
002 |  0.90408936 0.13358966 0.10614465 2.138059  ]

Once you introduce line-wrapping, it can end up looking like this:

001 | [0.35319467 0.03863742 0.08606454 0.08990213 0.71744555
0.43287303
002 |  0.90408936 0.13358966 0.10614465 2.138059  ]

As the output is limited to 10 lines, they aren't particularly useful -- I've not seen anyone make reference to the nth line of output. Also, as they are rendered in ascii, people sometimes mistakenly believe they are part of the output.

lxnn avatar Jul 24 '21 07:07 lxnn

I don't feel strongly either way. However, I do agree that they sometimes make the output ugly and that they seem to seldom be used. What does everyone else think?

MarkKoz avatar Jul 27 '21 19:07 MarkKoz

Removing the line numbers will only give us an extra 6 characters of width, so the above example would still be wrapped anyway.

There isn't really a good solution to this, since it fully depends on the width of your monitor, and now if you have a thread open, since that will limit width even further.

Having the line numbers can be useful when it wraps like this, since it shows where the newlines are from stdout.

We could possibly look at changing the characters we use however, as the fact they blend in with the actual output can be misleading.

ChrisLovering avatar Jul 27 '21 20:07 ChrisLovering

To be honest, I originally gave too much weight to the wrapping. The main issue is the potential confusion caused by the line numbers appearing to be part of the output.

As this tool is mostly used to demonstrate the output of code snippets to learners, I feel that messing with that output is problematic. I'm often saying "ignore the stuff on the left" in help-sessions.

lxnn avatar Aug 20 '21 04:08 lxnn

I would like to implement this for the upcoming Hacktoberfest 2021. @MarkKoz, if there are no objections to removing the line numbers, could you please assign the issue to me.

WillDaSilva avatar Sep 28 '21 19:09 WillDaSilva

@WillDaSilva I don't think Python Discord's projects will be participating in Hacktoberfest 2021. In any case, I don't know what the consensus on this issue is.

MarkKoz avatar Sep 30 '21 05:09 MarkKoz

@WillDaSilva I don't think Python Discord's projects will be participating in Hacktoberfest 2021. In any case, I don't know what the consensus on this issue is.

@MarkKoz from what I've seen we will not be participating

Kronifer avatar Oct 14 '21 14:10 Kronifer

I wouldn't mind trialling removing the numbers and see whether people notice/care.

wookie184 avatar Apr 14 '24 16:04 wookie184