define('DISALLOW_FILE_EDIT', true); define('DISALLOW_FILE_MODS', true); /dev/head — Всплывающие уведомления на python

Всплывающие уведомления на python

В Ubuntu появилась новая система оповещений, начиная по моему с версии 9.10. Теперь мы попробует это NotifyOSD в действии. Оказалось, что написать программу на python, которая будет выдавать уведомления, очень просто, я бы даже сказал через чур легко.

'''
notify.py - simply  libnotify sends desktop notifications.
Copyright (C) 2010  Komarov Alexander
GNU General Public License 3 (GPL v3)'''
import pynotify
import sys

def msg(title_text='Title',text='There has to be text.'):
    pynotify.init("Basics")
    n = pynotify.Notification(title_text,text)
    n.show()

def msg_icon(title_text='Title',text='There has to be text.',icon='/usr/
share/icons/gnome/32x32/emotes/face-smile.png'):
    pynotify.init("Basics")
    n = pynotify.Notification(title_text,text,icon)
    n.show()

demo.py

# -*- coding: utf-8 -*-
import notify
notify.msg("www.frit.su","FreeIT - некоммерческий проект , целью которого
является разработка, распространение, поддержка и внедрение свободного
программного обеспечения и свободной операционной системы GNU/Linux.")

demo1.py
# -*- coding: utf-8 -*-
import notify
notify.msg_icon("www.frit.su","FreeIT - некоммерческий проект , целью которого
является разработка, распространение, поддержка и внедрение свободного
программного обеспечения и свободной операционной системы GNU/Linux.",
'/usr/share/icons/Humanity/mimes/48/plan.svg')

Теги: , , ,

Дата: 1 декабря 2010

Автор: ignusius

Комментарии: 151

Комментарии: 151

  1. obviously like your website however you
    have to check the spelling on several of your posts.

    A number of them are rife with spelling problems and I to
    find it very bothersome to tell the reality nevertheless I will surely come back again.

    Here is my web page: adservemedia.com

  2. Having read this I thought it was rather enlightening.
    I appreciate you spending some time and effort to put this informative article together.
    I once again find myself personally spending a lot of time
    both reading and commenting. But so what,
    it was still worth it!

    Feel free to surf to my webpage: alltechmedia.org

  3. Paragraph writing is also a fun, if you know after that you can write or
    else it is complex to write.

    My web page; check this

  4. Great info. Lucky me I recently found your website by chance (stumbleupon).
    I've book-marked it for later!

    Also visit my blog - More about the author

  5. I have been exploring for a bit for any high quality articles or weblog posts in this kind of house .
    Exploring in Yahoo I at last stumbled upon this web site.
    Reading this info So i'm satisfied to express that I've
    a very excellent uncanny feeling I found out exactly what I needed.
    I such a lot for sure will make sure to do not forget this
    website and provides it a look regularly.

    Look into my web-site - cruelpoker.com

  6. Hello, I want to subscribe for this blog to take most recent updates, therefore where can i do
    it please help. http://new.jesusaction.org/bbs/board.php?bo_table=free&wr_id=2859604

  7. This article clearly explains selling bitcoin in india with practical examples.

  8. You actually make it seem so easy with your presentation but I
    find this topic to be really something that I think I would never understand.

    It seems too complex and very broad for me. I'm looking forward for your next post,
    I'll try to get the hang of it!

    my web blog ... Robo Luva Bet

  9. Этот сайт pin up — настоящая находка.

    пинап кз

  10. Boost your crypto confidence by exploring options for selling bitcoin in india.

  11. This guide offers valuable advice for selling bitcoin in india.

Оставить комментарий

*

Комментарий:

Ваш e-mail не будет опубликован.
Обязательные поля помечены *

Разрешенные HTML теги:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>