【问题标题】:How to run a batch file without launching a “command window”?如何在不启动“命令窗口”的情况下运行批处理文件?
【发布时间】:2015-09-03 08:52:30
【问题描述】:

我不想在运行应用程序时打开命令窗口, 我在创建基于 python 的应用程序的 .exe 文件时将快捷方式指向 .bat 文件

.bat 文件中的代码是这样的 @python\python.exe -m demo.demo %*

demo 是我的应用程序名称(.bat 文件名)

【问题讨论】:

    标签: python batch-file window command


    【解决方案1】:

    使用 pythonw.exe 而不是 python.exe 运行您的脚本,它不会显示 dos shell。

    【讨论】:

    • 虽然我使用 pythonw.exe 运行,但在执行应用程序时我仍然打开 doss shell
    • 那是运行bat文件。使用所需参数创建 pythonw 的快捷方式并跳过 bat 文件。
    猜你喜欢
    • 2021-08-17
    • 2013-01-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-07
    • 2014-02-23
    相关资源
    最近更新 更多