Using Python to automatically boot my computer at a specific time and play a podcast

Irmen de Jong irmen.NOSPAM at xs4all.nl
Mon Jun 17 13:03:52 EDT 2013


On 17-6-2013 15:24, inq1ltd wrote:
> On Sunday, June 16, 2013 12:06:08 PM C. N. Desrosiers wrote:
> 
>> Hi,
> 
>>
> 
>> I'm planning to buy a Macbook Air and I want to use it as a sort of alarm.
>> I'd like to write a program that boots my computer at a specific time,
>> loads iTunes, and starts playing a podcast. Is this sort of thing possible
>> in Python?

You can use the osascript utility to send commands to itunes, and invoke it from Python
like this:

import subprocess
listname = "My Playlist"
subprocess.call(["osascript", "-e", "tell application \"iTunes\" to play playlist
\"{0}\"".format(listname)])

But that seems overkill (using Python to use Applescript to control iTunes)...

Irmen




More information about the Python-list mailing list