所以我只是使用PyInstaller将.py脚本转换为.exe文件。但是当我尝试启动.exe文件时,它会立即启动然后崩溃。当我从.py文件直接启动它时,它运行正常,我甚至尝试使用另一个脚本,一切正常。
另外,当我在pyinstaller
中输入cmd
时,我看到错误说:
pyinstaller:error:需要以下参数:scriptname
这是我的代码:
import os
fid = open("w&c.txt","r")
ilw = 0
j = 0
temp = fid.read().splitlines()
for x in range(0, 7):
ans = temp[ilw]
print("Nouveau mot:")
for y in range (0, 3):
ccl = temp[ilw+y+1]
print("L'indince N°%d est: ' %s ', devinez:" % (y+1,ccl))
rep = input("> ")
if rep == ans or rep == ans.lower():
j += 1
print("Bravo, bonne réponse.\n")
break
elif y == 2:
print("Dommage, le mot était < %s >.\n" % ans)
ilw += 4
fid.close()
print("Merci d'avoir joué, vous avez eu %d bonnes réponses sur 7" % j)
os.system("PAUSE")
也许有事可做,因为我正在使用文件或问题出在我的PyInstaller中?任何线索?