PiSupply / PaPiRus

Resources for PaPiRus ePaper eInk displays
https://www.pi-supply.com/product/papirus-epaper-eink-screen-hat-for-raspberry-pi/
Other
346 stars 88 forks source link

papirus-write parsing line break \n #168

Closed jarrah31 closed 6 years ago

jarrah31 commented 6 years ago

I know that PapirusTextPos will take into account \n as a line break using the following example:

text.AddText("hello\nworld", 10, 20, Id="Start" )

However if I use papirus-write, \n just appears within the text on the display.

papirus-write.py "hello\nWorld"

Is there a workaround by any chance please?

Thanks.

tvoverbeek commented 6 years ago

The '\n' is not converted by the shell (bash). This works: papirus-write $'hello\nWorld' See e.g. https://stackoverflow.com/questions/3005963/how-can-i-have-a-newline-in-a-string-in-sh Note: you need to use single quotes after the '$', double quotes do not work.

jarrah31 commented 6 years ago

Ahh of course, thank you!

shawaj commented 6 years ago

@jarrah31 @tvoverbeek added to the main readme now for reference :-)