关于python打包成.exe运行文件时,执行出现了failed to execute script,求助

1.我是想实现这段代码能够在双击后在后台直接运行,不需要显示DOS窗口
但是我加了-w参数后,打成的.exe文件运行后就出现了failed to execute script错误,求解,是我程序写的有问题吗?小白一个,求解

图片说明

https://blog.csdn.net/qq_42063091/article/details/82423221

试试这样pyinstaller -F -w -i ico_path py_path