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
  • 57,590
  • 26
  • 140
  • 166
Alexey
  • 15
  • 3

1 Answers1

0

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

MoRe
  • 2,296
  • 2
  • 3
  • 23