red-data-tools / YouPlot

A command line tool that draw plots on the terminal.
MIT License
4.12k stars 57 forks source link

Output \n as a string in example code #1

Closed 284km closed 3 years ago

284km commented 3 years ago

Current output is:

$ echo "from numpy import random;" \
>      "n = random.randn(10000);"  \
>      "print('\n'.join(str(i) for i in n))"
from numpy import random; n = random.randn(10000); print('
'.join(str(i) for i in n))

After this change, I think it is originally expected string:

$ echo "from numpy import random;" \
>      "n = random.randn(10000);"  \
>      "print('\\\n'.join(str(i) for i in n))"
from numpy import random; n = random.randn(10000); print('\n'.join(str(i) for i in n))
kojix2 commented 3 years ago

Thanks for the pull request. I can confirm that the problem is reproduced on mac OS. However, on my computer, the original is correct.

kojix2 commented 3 years ago

That's not an OS difference, but a shell difference.

Thanks for the report.