Ich habe ein Skript geschrieben, das pynotify verwendet, um eine Warnung zu geben. es funktioniert gut, wenn ich es (python script.py
) ausführen, aber wenn es von Cron mit ausgeführt wird, funktioniert es nicht! Ich habe keine Ahnung warum. Hier ist der Code-Schnipsel:PyNotify funktioniert nicht von Cron?
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()
Richten der Ausgabe zu ~/log.file gibt: <pynotify.Notification object at 0x16d4e60 (NotifyNotification at 0x13804e0)>
und keine Fehler, so dass ich bin mir nicht ganz sicher, wo sonst zu suchen.
, das war das Problem! Vielen Dank! –
@Ivo Wetzel nette Erklärung, aber es funktioniert nicht für mich in gnome ubuntu – roshan