I have a text file on sd card which I am reading through python. I want to copy contents of this file and save in another sd card, and as I make changes to original file it should reflect run time on the copied version in real time
I went through Copying from one text file to another using Python but this is static implementation(copied file does not change runtime with changes in original file)
My code:
import os
with open("/path/to/file.txt", 'r') as f:
print (f.read())
#f.flush()
file = open("/path/to/another/file.txt", 'w')
while True:
file.write( f)
file.flush()
# file.close()