show. Align content line, after line number in read_lines()
This commit is contained in:
parent
b6799ab360
commit
101a1e09e7
|
@ -145,12 +145,13 @@ def read_lines(f):
|
||||||
if not tyto.exists(f): logs.out("1", f, True)
|
if not tyto.exists(f): logs.out("1", f, True)
|
||||||
|
|
||||||
datas = open(f).read()
|
datas = open(f).read()
|
||||||
|
|
||||||
|
# Align content line, after line number
|
||||||
ln_datas = len(datas.splitlines()) + 1
|
ln_datas = len(datas.splitlines()) + 1
|
||||||
sp_max = len(str(ln_datas))
|
sp_max = len(str(ln_datas))
|
||||||
spaces = '%s'%(sp_max * " ")
|
|
||||||
for ln, line in enumerate(datas.rsplit('\n'), 1):
|
for ln, line in enumerate(datas.rsplit('\n'), 1):
|
||||||
sp = sp_max - len(str(ln))
|
sp = sp_max - len(str(ln))
|
||||||
|
|
||||||
print(' │ %s %s│ %s'%(ln, int(sp) * " ", line))
|
print(' │ %s %s│ %s'%(ln, int(sp) * " ", line))
|
||||||
|
|
||||||
dom.valid()
|
dom.valid()
|
||||||
|
|
Loading…
Reference in New Issue