0

From the log file I need the last lines. I listed them in [-1:-7]

f_read = open("C:\logs.txt", "r")
status = f_read.readlines()[-1:-7]
print(status)

Python outputs

[]

How can I make it show strings?

desertnaut
  • 52,940
  • 19
  • 125
  • 157
Alexey
  • 15
  • 2

1 Answers1

0

[-7:-1] it must be from lower to upper

MoRe
  • 730
  • 2
  • 15