hello.py到python 3.6中的hello.exe转换

时间:2017-07-10 15:10:03

标签: python cx-freeze python-3.6

我创建了一个hello.py,它将打印hello world 10次,每次延迟1秒。

import time
for i in range(0,10):
   print("hello")
   time.sleep(1)

现在,当我使用cx_Freeze方法将其转换为exe时,会创建hello.exe并且它未运行。我正在Windows 7 64位PC上运行它。

2 个答案:

答案 0 :(得分:0)

You can check out pyinstaller. It takes python code and converts it into an executable. It might be overkill for what you're doing but it's worth a shot if the method you're currently using doesn't work. Check out the options you can run it with to make it a standalone executable.

答案 1 :(得分:0)

您可以尝试脚本:

https://github.com/soimort/you-get/wiki/cx_Freeze

you-get替换为hello.py