【问题标题】:Flask application does not compile when I put the pywhatkit library inside当我将 pywhatkit 库放入其中时,Flask 应用程序无法编译
【发布时间】:2023-02-07 02:04:07
【问题描述】:

我在烧瓶中有一个应用程序,我试图在该应用程序中插入一个代码以自动将消息发送到 whatssap。

  • 代码:
import pywhatkit as pwk
import time


def whats():
    tim = time.localtime()

    hour = int(time.strftime("%H", tim))
    min = int(time.strftime("%M", tim))

    if min==59:
        min = 0
    else:
        min += 1
    # using Exception Handling to avoid unexpected errors
    try:
          # sending message in Whatsapp in India so using Indian dial code (+91)
          pwk.sendwhatmsg("+5587988758805", "Trabalhador sem EPI!", hour, min)
          print("Message Sent!") #Prints success message in console
    # error message
    except: 
        print("Error in sending the message")

这两个代码都运行良好,但是当我将这两个代码放在一起时,代码无法编译。

我做了一些测试:

  1. 我试图在烧瓶应用程序中只使用import pywhatkit as pwk

  2. 我试图在另一个 python 文件中使用代码并导入;

  3. 我试图将这两个代码放在同一个 python 文件中。

    在所有情况下,代码都无法编译,当我调试测试 1 的代码时,出现以下错误:

    Exception has occurred: SystemExit 3
      File "C:\Users\diego\codes\Working\modify.py", line 96, in <module>
        app.run(debug=True)
    

    为什么在我放置时无法编译我的代码pywhatkitFlask 应用程序中的库?

【问题讨论】:

  • 对于所有遇到类似问题的人,我能够通过安装来解决pywhatkit5.0版

标签: python flask whatsapp messaging


【解决方案1】:

对于所有遇到类似问题的人,我能够通过安装来解决pywhatkit版本 5.0。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-19
    • 1970-01-01
    相关资源
    最近更新 更多