New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

win10toast-click

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

win10toast-click

An easy-to-use Python library for displaying Windows 10 Toast Notifications. Improved version of win10toast and win10toast-persist to include callback_on_click to run a function on notification click, for example to open a URL.

  • 0.1.2
  • PyPI
  • Socket score

Maintainers
1

win10toast-click

An easy-to-use Python library for displaying Windows 10 Toast Notifications. Improved version of win10toast and win10toast-persist to include callback_on_click to run a function on notification click, for example to open a URL.

Context

1: Original module.

2: Tweaked version with support for notifications that persist in the notification center.

This fork is an improved version of 2 ^ with callback_on_click that allows to run a function on notification click, for example to open a URL.

Installation

pip install win10toast-click

Example

# modules
import webbrowser
from win10toast_click import ToastNotifier 

# function 
page_url = 'http://example.com/'

def open_url():
    try: 
        webbrowser.open_new(page_url)
        print('Opening URL...')  
    except: 
        print('Failed to open URL. Unsupported variable type.')

# initialize 
toaster = ToastNotifier()

# showcase
toaster.show_toast(
    "Example two", # title
    "Click to open URL! >>", # message 
    icon_path=None, # 'icon_path' 
    duration=5, # for how many seconds toast should be visible; None = leave notification in Notification Center
    threaded=True, # True = run other code in parallel; False = code execution will wait till notification disappears 
    callback_on_click=open_url # click notification to run function 
    )

Release History

  • 0.1.2: Prepared for distribution on Python Package Index (PyPI).
  • 0.1.1: Renamed repo.
  • 0.1: Initial release.

Versioning

Using SemVer.

License

GNU General Public License v3.

Acknowledgements

Original modules

Stack Overflow

Packaging & distribution

Icon

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc