i have one python script send message to my phone using pywhatkit
it can run flawlessly on geany IDE.but when i invoke from terminal like sudo python3 /home/pi/Desktop/pyf/whatsappsend.py it run in terminal but it doesn't open whatsapp web and send message.
the script as follow
#!/usr/bin/env python
# -*- coding: utf_8 -*-
import pywhatkit
import datetime
import time
from time import strftime,localtime
from time import strftime,gmtime
while True:
print('running')
dt_gmt = strftime("%Y-%m-%d %H:%M:%S", localtime())
print(dt_gmt)
time_only = datetime.datetime.now().time()
pywhatkit.sendwhatmsg_instantly("+65XXXXXXX", str("hello")+str(dt_gmt), 30, True, 10)
time.sleep(60)
pls help me how to make it run on terminal as i want to put in on crontab later on.
Thanks in advance.
Myo
it should be new.i just download noobs yesterday
– sayagyi myo Nov 17 '21 at 06:16python3 /home/pi/Desktop/pyf/whatsappsend.py
with no sudo and see how that works. – Dougie Dec 17 '21 at 10:35