python script
Hi all
I am interested in making a python script which would after the specified interval of time play a midi file. It's like an alarm clock but the only catch is that I want it to keep repeating after say every 15 minute or so. So, if I run the script, it plays that file(the alarm sound) after every 15 minutes. Guide me ppl. May the forces be with you. :D |
$ man crontab
It is the standard tool for doing such things, and I think you'll like it once you get the hang of the syntax. 'at' is also excellent for one-time scheduling (which I realize you're not doing here, but it's still good to know): Code:
$ at now + 30 min <enter> Code:
while (1) { HTH. |
Hey, thanks rkef.
I'll still try it first in Python and then in Perl. So maybe I'll get back with my hiccups. :) Cheers. |
It'd be a great help if someone out here can give me a step-by-step to doing this.
|
What distro are you using? Check if you have a crond process running.
|
Something like this
Code:
#!/usr/bin/python |
I'll see and then I'll get back.
|
Hi.
I am using RH 9. Could this be possible if I wish to play an mp3 or a wav file instead of just midi. |
change the double quoted text in this line : os.system("pmidi my.mid")
to execute anything you want. |
Ok. So I have RH9 and still getting nowhere.
I have checked and crond services are running. Kindly guide me in making this script. |
Code:
#!/usr/bin/python Enjoy! |
Please sort this out for me. When I type at the console
kmidi abc.mid it says Xlib: extension "GLX" missing on display ":0.0". /dev/dsp doesn't support 4096-byte buffer fragments But it starts playing. But when I run the python script it says Xlib: extension "GLX" missing on display ":0.0". /dev/dsp doesn't support 4096-byte buffer fragments Kmidi:Problem with PIPE_INT_WRITE due to:Broken pipe Xlib: extension "GLX" missing on display ":0.0". /dev/dsp doesn't support 4096-byte buffer fragments It opens up kmidi but dies not play the file, WHY? |
I also realised that I could not specify the path to the midi file in the script so I moved the file to he directory where the script is.
|
<bump>...
|
Hi all. I got it. Thanks for your time and support.
Thank you. |
All times are GMT -5. The time now is 03:47 PM. |