I agree with the track data stored in the file, and then the signal module to inform your script that the new track data is ready to be read, attach a function, say, SIGUSR1, and everything is ready, without the risk of partially written files.
In the script, put:
import signal signal.signal(signal.SIGUSR1, read_track_data)
then (linux way, but will be very different on Windows) just send a signal to your script right after updating the track data file.
$kill -n 10 PID_OF_YOUR_SCRIPT
source share