def Start_App():
    if is_ocr_running():
        print("app 已经启动!")
        return
    if not inline_app:
        subprocess.Popen([sys.executable, "app.py"],
                         creationflags=subprocess.CREATE_NEW_CONSOLE)
    else:
        subprocess.Popen([sys.executable, "app.py"],
                         stdout=subprocess.DEVNULL,
                         stderr=subprocess.DEVNULL)
    print("正在等待app启动完毕……")
    import time
    start_time = time.time()
    while time.time() - start_time <= 60:
        if is_ocr_running():
            print("app启动完毕!")
            return
    print("app可能启动失败。")
Esempio n. 2
0
def ShowOCR():
    print("* OCR模式 ocr_mode:", ocr_mode)
    if baidu_apiKey != "":
        print("* BaiduAPI 已配置!")
    else:
        print("* BaiduAPI 未配置,前往config.ini - baidu_apiKey进行配置")
    print("* 本地OCR状态:", end="")
    if is_ocr_running():
        print("运行中")
    else:
        print("未运行")