Please help . I am starting to code and this is not working .
Code :
from plyer import notification
def notifyMe (title,message):
notification.notify(
title = title,
message = message,
app_icon = None,
timeout = 10
name = None,
)
if name== ("main"):
notifyMe ("Palash","Lets stop the spread of this virus")
Terminal
PS E:\WhiteHat JR\Hackathon\TryOne - Notification> pip install plyer
Collecting plyer
Downloading plyer-1.4.3-py2.py3-none-any.whl (133 kB)
ication> python main.py
PS E:\WhiteHat JR\Hackathon\TryOne - Notification> python main.py
if name== (“main”):
NameError: name ‘name’ is not defined
What the library plyer It’s supposed to do? I ran it on IDLE and, despite It didn’t throw any error, I didn’t have any kind of feedback either.
from plyer import notification
def notifyMe (title,message):
notification.notify(
title = title,
message = message,
app_icon = None,
timeout = 10,
name= None)
if name == ("main"):
notifyMe ("Palash","Lets stop the spread of this virus")
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.