使用 pywhatkit 发送自动消息后自动关闭选项卡
auto closing of tabs after sending auto message using pywhatkit
我想使用 pywhatkit 发送自动消息。
这是通过以下代码完成的:
import pywhatkit
pywhatkit.sendwhatmsg("+92xxxxxxxxxx", "Hello ", 22, 28)
print("Successfully Sent!")
我已经关注了这个 link :
https://www.geeksforgeeks.org/introduction-to-pywhatkit-module/
我只想问一下有什么方法可以在发送自动消息后自动关闭标签页吗?
谢谢
如果只想关闭google chrome标签,可以模拟按Ctrl+W
关闭
你可以在cmd中使用keyboard
库-pip install keyboard
,然后:
import keyboard
keyboard.press_and_release('ctrl+w')
或者您可以使用 `win32`、`pyautogui` 或任何其他可以让您执行此操作的库
sendwhatmsg 还有一个参数是 tab_close
import pywhatkit
pywhatkit.sendwhatmsg("+92xxxxxxxxxx", "Hello ", 22, 28,tap_close=True)
print("Successfully Sent!")
我想使用 pywhatkit 发送自动消息。 这是通过以下代码完成的:
import pywhatkit
pywhatkit.sendwhatmsg("+92xxxxxxxxxx", "Hello ", 22, 28)
print("Successfully Sent!")
我已经关注了这个 link : https://www.geeksforgeeks.org/introduction-to-pywhatkit-module/
我只想问一下有什么方法可以在发送自动消息后自动关闭标签页吗? 谢谢
如果只想关闭google chrome标签,可以模拟按Ctrl+W
关闭
你可以在cmd中使用keyboard
库-pip install keyboard
,然后:
import keyboard
keyboard.press_and_release('ctrl+w')
或者您可以使用 `win32`、`pyautogui` 或任何其他可以让您执行此操作的库
sendwhatmsg 还有一个参数是 tab_close
import pywhatkit
pywhatkit.sendwhatmsg("+92xxxxxxxxxx", "Hello ", 22, 28,tap_close=True)
print("Successfully Sent!")