【发布时间】:2014-03-08 04:52:23
【问题描述】:
我在我的程序中使用了 Py2exe:
import time
start = time.clock()
def sortare( n ):
return sorted(str(n))
def main():
n = 99999
while True:
if sortare (2 * n) == sortare(3 * n) == sortare(4 * n) == sortare(5 * n) == sortare(6 * n):
print (n)
break
n += 1
print (time.clock() - start)
if __name__ == "__main__":
main()
这是我的 setup.py:
from distutils.core import setup
import py2exe
setup(windows=['C:\Users\Rares\workspace\Test\src\Test.py'])
我已经将 python 2.7.6 和 py2exe 安装为 64 位,因为我的机器是这样的。我在 Windows CMD 中使用python C:\Python27\Test\test.py py2exe。
我有一个名为 distr 我的程序所在的文件夹,但是当我运行 exe 时,没有任何反应。甚至没有错误或 txt 文件。
感谢您的任何建议。
【问题讨论】:
-
你双击exe运行了吗?它可能运行和退出速度如此之快,你什么也看不到。您是否尝试过从命令行运行 exe?
-
我确实遇到了一些只打开和关闭的 exe,但是我使用的这个算法至少需要 1 秒才能工作。即便如此,绝对没有图形提示程序已经运行。同样从 CMD 运行它,它只显示一个空白行。
标签: python python-2.7 py2exe