Answer the question
In order to leave comments, you need to log in
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
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
Install pywin32 and use this code.
UPD. Found another one here . It seems to be for Windows 10, but you can try it.
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 questionAsk a Question
731 491 924 answers to any question