发送 Whatsapp 消息时,pywhatkit 中的循环在 python 中不起作用
在下面的代码中,21 是小时,53 是分钟,10 是等待时间 在这段代码中,我想频繁地循环发送消息,但失败了。我也尝试过 for 循环,但它不起作用。任何人都知道如何使用 python 在 Whatsapp 中发送 100 条消息请帮助我
import pywhatkit
from flask import Flask
while 1:
pywhatkit.sendwhatmsg("+9198xxxxxxxx", "Hi",21,53,10)
In below code 21 is hour and 53 is min and 10 is wait time
in this code I want to send message in loop frequently but I failed. I also tried for loop but it is not working. Any body know how to send 100 message in whatsapp using python please help me
import pywhatkit
from flask import Flask
while 1:
pywhatkit.sendwhatmsg("+9198xxxxxxxx", "Hi",21,53,10)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
获取您当前的时间并添加一两分钟的延迟,然后应用在我的情况下有效的循环,我相信它也适合您
python3
pywhatkit
while循环
get your current time and add one or two minute delay then apply the loop it worked in my case, i am sure that it will work for you too
python3
pywhatkit
while loop
看,首先,pywhatkit 不会自动发送消息,它只是键入消息并打开该人的 DM,我们必须按 Enter 才能发送,因此要执行此操作,您也必须按 Enter a 100 次。其次,你不能这样做,因为使用 sendwhatmsg_instantly() ,消息会立即发送,并且仅使用 sendwhatmsg() 方法需要时间部分,并且每次登录时间都不同,你无法确定这一点,所以不要使用 Whatsapping给某人发消息 100 次,改为使用 smtplib 发送电子邮件--
look, first of all, pywhatkit does not send a message automatically, it just types the message and opens the DM of that person and we have to press enter to send, so to do this, you would have to press enter a 100 times too. Secondly, You cant do this because using sendwhatmsg_instantly(), the message goes on the spot and using only the sendwhatmsg() method requires a section for time and every time the login time is different and you cant determine that, so instead of whatsapping a message to someone 100 times, send an email instead using smtplib--