Tips for a *nix python cli - Programming On Unix

Users browsing this thread: 1 Guest(s)
darthlukan
Members
To add on to the tips, here's a snippet I tend to use quite a bit for when I want my utilities to use notifications. The docs for notify2 are a bit wonky due to all of the possibilities, but if you just want a simple notification integration function, here it is:

Code:
import notify2

    ...

    def note_set_and_send(app, summary):
    """
    Creates a DBUS notification.
    """
    notify2.init('Pounce: ')
    return notify2.Notification(app, summary).show()

For an example of this in practice, you can see this silly utility that I wrote when I was first learning to program (a few years ago): https://github.com/darthlukan/pounce
Github: https://github.com/darthlukan
CRUX Ports: http://ports.brianctomlinson.com
GPG: 3694569D
"We're all human, act accordingly." -- Me


Messages In This Thread
Tips for a *nix python cli - by venam - 11-06-2013, 05:36 AM
RE: Tips for a *nix python cli - by gurhush - 12-06-2013, 07:30 PM
RE: Tips for a *nix python cli - by venam - 12-10-2014, 07:25 AM
RE: Tips for a *nix python cli - by b4dtR1p - 12-10-2014, 08:38 AM
RE: Tips for a *nix python cli - by projektile - 13-10-2014, 03:09 AM
RE: Tips for a *nix python cli - by ashen - 14-09-2015, 08:45 PM
RE: Tips for a *nix python cli - by venam - 15-09-2015, 01:52 AM
RE: Tips for a *nix python cli - by darthlukan - 15-09-2015, 02:18 AM
RE: Tips for a *nix python cli - by venam - 15-09-2015, 03:16 AM
RE: Tips for a *nix python cli - by darthlukan - 15-09-2015, 10:29 AM
RE: Tips for a *nix python cli - by ki113d - 17-09-2015, 10:15 PM
RE: Tips for a *nix python cli - by venam - 03-10-2015, 09:57 AM