A
A
Arbil2019-09-30 17:03:18
Python
Arbil, 2019-09-30 17:03:18

Is it possible to program that can show the user a notification?

Hello
In general, I'm wondering how to write a program in Python that shows a notification?
That is, here 5d920abd387d4740071099.jpeg
Well, let's say a timer to turn off the PC
And when half the time passes, the notification "Half time left" pops up

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Yakushenko, 2019-09-30
@Arbil

Install pywin32 and use this code.
UPD. Found another one here . It seems to be for Windows 10, but you can try it.

E
Eugene, 2019-10-01
@BeatHazard

I don’t know if it’s relevant or not, but there is a Powershell solution for such notifications, it can be easily applied to your task, including restarting the PC.
Add-Type -AssemblyName System.Windows.Forms
$global:balmsg = New-Object System.Windows.Forms.NotifyIcon
$path = (Get-Process -id $pid).Path
$balmsg.Icon = [System.Drawing.Icon ]::ExtractAssociatedIcon($path)
$balmsg.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Warning
$balmsg.BalloonTipText = 'This is the toast text for a Windows 10 user'
$balmsg.BalloonTipTitle = "Warning $Env: USERNAME"
$balmsg.Visible = $true
$balmsg.ShowBalloonTip(10000)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question