python-liquidcrystal_i2c icon indicating copy to clipboard operation
python-liquidcrystal_i2c copied to clipboard

Usability fix

Open kornpow opened this issue 8 years ago • 2 comments

Hi, I am going to use this library for a project I think, I hope I could potentially help contribute some of the missing function potentially too. Just getting starting with using the library, I noticed that if you write to a line, it just right shifts the text currently on that line. My workaround for this, which maybe useful to add in is: lcd.printline(0,"Text String".ljust(20," ")) The ljust command fills in the remaining characters with spaces. I think this makes more sense for usability.

kornpow avatar Jan 25 '18 16:01 kornpow

Hi. I use it like this here:

line1 = get_ip(interface).rjust(16)
line2 = '{}{:9d} pkt/s'.format(indicator, rx_packets_delta)
lcd.printline(0, line1)
lcd.printline(1, line2)

this is similar to what you do.

You prefer, that printline automatically fills the rest of the line with spaces?

pl31 avatar Jan 25 '18 18:01 pl31

Yes I ended up doing similar to what you were saying. Id prefer it that way for printline, as I think that is the primary use case. I'd think if there was a print command it wouldnt fill in the line, but printline I think should. Just an idea though,

kornpow avatar Jan 25 '18 21:01 kornpow