i tried to make auto check if file is modified then print and send to discord using webhook, but it print the last line and before the last line. i just want to print the last line. here is the code
def readfile():
with open("test.txt", "r") as t:
read = t.readlines()
return read
before = readfile()
while True:
after = readfile()
if before != after:
for line in after:
if line not in before:
print(line)
sendembed()
before = after
im new to python, anyone can help me?