I use linux, e.g. Pepermint OS. There is a mysql table, there is numeric field as a flag. The table only has 1 record. If the field contain 1, I want to play a short mp3 once an then update the field to 0/zero again. There is an application that can play mp3 from command prompt, e.g mpg123.
To play the mp3, I use the following script :
import subprocess
call = "mpg123 ting_tong1.mp3 & "
p = subprocess.Popen( call, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
I want the script run in the background, like a service in Windows. I have been trying night and day with several daemon library in python, but no luck.
There should a music sound e.g. the mp3 sound, every time the field changed from 0 to 1 !
The daemon run but the music only run once :( . How to do that ? Thanks !