【发布时间】:2020-03-15 12:26:22
【问题描述】:
请在下面找到我写的python代码:
from tkinter import *
import os
fenetre = Tk()
label = Label(fenetre, text="Power BI is gonna be open as soon as the program finds an optimal solution.")
label.pack()
fenetre.mainloop()
os.system('cmd /c "pbixrefresher C:\\Users\\LFM\\Desktop\\Optimization.pbix '
'--refresh-timeout 300000 --no-publish --init-wait 6"')
我在使用 pyinstaller 创建 exe 文件时使用了“-w”。当我按照要求双击创建的 exe 文件时,只出现一个窗口而不是控制台。但是,Power BI 没有打开。 Power BI 仅在我关闭窗口时打开。并且,在那一刻,命令提示符出现。
pyinstaller -F ^
-w ^
C:\Users\LFM\PycharmProjects\Tests\Tests.pyw
有没有办法即使我使用 os.system 也不打开命令提示符?
【问题讨论】:
标签: python-3.x cmd exe pyinstaller os.system