Skip to content

Instantly share code, notes, and snippets.

@geekykant
Created March 28, 2019 08:04
Show Gist options
  • Save geekykant/549be4c34ac719b0a27570af4f28baa3 to your computer and use it in GitHub Desktop.
Save geekykant/549be4c34ac719b0a27570af4f28baa3 to your computer and use it in GitHub Desktop.
Play music for every new line added to text file
import os
old_ll = None
new_ll = None
with open("values.txt", "r+") as f:
for old_ll in f:
pass
while(1):
with open("values.txt", "r+") as f:
for new_ll in f:
pass
if(old_ll!=new_ll):
old_ll = new_ll
os.system("open aduio.mp3")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment