Giter VIP home page Giter VIP logo

zroya's Introduction

License: MIT Documentation Status PyPI version PyPI status Maintenance

zroya

Zroya is python wrapper around win32 API for creating Windows notification. See Read The Docs documentation.

Prerequisites

Zroya requires you to install pypiwin32.

> pip install pypiwin32

Installation

Zroya is available from pypi:

> pip install zroya

Example

# Import NotificationCenter
from zroya import NotificationCenter

quit = False

# This function is called when user clicks on notification
def click_callback(nid, data):
    global quit

    print("User clicked on your notification!")
    quit = True

# Create instance of NotificationCenter
nc = NotificationCenter()

# Create new notification
nc.create("Test Notification", "Longer notification description. \n With multiline support!", on_click = click_callback)

# Update function should be called in your event loop. In this example, we will create our own event loop:
while nc.update():
    if quit:
        nc.quit()

In action

You may use one for three predefined notification types:

NotificationCenter.ICON_INFO

nc.create("Info notification", "This is informative notification.\nClick on me!", icon=NotificationCenter.ICON_INFO)

Info notification

NotificationCenter.ICON_WARNING

nc.create("Warning notification", "This is warning notification.\nClick on me for sure!", icon=NotificationCenter.ICON_WARNING)

Warning notification

NotificationCenter.ICON_ERROR

nc.create("Error", "This is error notification.\nDo not click me, you would find out!", icon=NotificationCenter.ICON_ERROR)

Error notification

Custom icon

Or pass an absolute path to .ICO file as icon parameter and use whatever icon you like.

Notification center

All notifications are automatically added to Windows 10 notification center after timeout: Windows 10 notification center example

zroya's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.