def process_for_playOrStop(): while True: play = fileDealer.fileReader("buttons/next") if (play == "True"): fileDealer.fileWriter("buttons/next") print("Play button is pressed, running program") lock.acquire(block=True) firstDownload = PlayEvent() firstFile = firstDownload.download( firstDownload.cursor[0]["id"], firstDownload.cursor[0]["title"]) playFirst = Reader(firstFile) playFirst.go_for_play() print('Done, Exiting and releasing play lock') SetDefaults() lock.release()