我想将python程序转换为可在未安装python的Windows PC上运行的Windows 10或7应用程序。我使用python 3.7。
我认为这无关紧要,以防万一,这是我的代码:
from tkinter.messagebox import showwarning
from tkinter import *
import schedule
from win10toast import ToastNotifier
toaster = ToastNotifier()
root = Tk()
root.withdraw()
def shownotification():
toaster.show_toast("Screen Time",
"Take a break for 20 seconds",
duration=5)
schedule.every(20).minutes.do(shownotification)
while True:
schedule.run_pending()
您将需要pyinstaller和pip
这里是有关如何下载点子的链接:https://pip.pypa.io/en/stable/installing/
打开终端并转到您的python文件所在的目录。
此后继续输入pyinstaller filename.py
您可以尝试其他可以使您的应用成为图标的命令,以及该视频中的其他命令: