Start = 5 #Starts Reading at line 5
End = 10 #Stops Reading at line 10
URL = "https://pastebin.com/raw/"
contents = requests.get(URL).text.split('\n')
this is my current code to reading a pastebin, I was wondering if there was a way where i could start reading at a specific line and stop reading at the second specific line.
My pastebin looks something this
>Solution :
split gives you a list so just slice the list from start to end.
URL = "https://pastebin.com/raw/"
contents = requests.get(URL).text.split('\n')[start:end]