I've written a script that uses pynotify to give an alert. it works just fine when I run it (python script.py
), but when run from cron with 00 * * * * myname python ~/scripts/script.py
, it doesn't work! I haven't a clue why. Here's the snippet:
if os.path.isfile(os.path.expanduser('~/.thumbnails/normal')+'/'+thumbnail):
n = pynotify.Notification(video_file[0], 'finished download', os.path.expanduser('~/.thumbnails')+'/'+thumbnail)
else:
n = pynotify.Notification(video_file[0], 'finished download', '/usr/share/icons/gnome/48x48/mimetypes/gnome-mime-application-x-shockwave-flash.png')
print n
n.show()
directing the output to ~/log.file gives: <pynotify.Notification object at 0x16d4e60 (NotifyNotification at 0x13804e0)>
and no errors, so i'm not quite sure where else to look.