-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwhatsappmsg.py
More file actions
36 lines (31 loc) · 760 Bytes
/
Copy pathwhatsappmsg.py
File metadata and controls
36 lines (31 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# # importing the module
# import pywhatkit
#
# # using Exception Handling to avoid
# # unprecedented errors
# try:
#
# # sending message to receiver
# # using pywhatkit
# pywhatkit.sendwhatmsg("+918805643291",
# "Hello from GeeksforGeeks",
# 22, 28)
# print("Successfully Sent!")
#
# except:
#
# # handling exception
# # and printing error message
# print("An Unexpected Error!")
# importing the module
import pywhatkit
# using Exception Handling
# to avoid exceptions
try:
# it plays a random YouTube
# video of GeeksforGeeks
pywhatkit.playonyt("GeeksforGeeks")
print("Playing...")
except:
# printing the error message
print("Network Error Occured")