生成exe问题

生成exe问题

Python版本 2.5.2
py2exe版本py2exe-0.6.8.win32-py2.5.exe

脚本delfile.py
from datetime import timedelta,date
import string
import os
d=(date.today()-timedelta(1)).isoformat()
t=string.atol(d.replace('-','') + "000000")
channellist=os.listdir('d:/movie')
for channeldir in channellist:
    channeldir_path=os.path.join('d:/movie/',channeldir)
        os.chdir(channeldir_path)
        filelist=os.listdir(channeldir_path)
        for filename in filelist:
        f=string.atol(filename[0:14])
                if t > f:
                        f_path=channeldir_path + "/" + filename
                        os.remove(f_path)


脚本setup.py
# setup.py

from distutils.core import setup
import py2exe
setup(name="delfile",scripts=["delfile.py"])


运行 C:\python25\python setup.py py2exe
running py2exe
running build_scripts
*** searching for required modules ***
*** parsing results ***
creating python loader for extension 'unicodedata' (C:\Python25\DLLs\unicodedata.pyd -> unicodedata.pyd)
creating python loader for extension 'bz2' (C:\Python25\DLLs\bz2.pyd -> bz2.pyd)
*** finding dlls needed ***
*** create binaries ***
*** byte compile python files ***
byte-compiling C:\Python25\build\bdist.win32\winexe\temp\bz2.py to bz2.pyc
byte-compiling C:\Python25\build\bdist.win32\winexe\temp\unicodedata.py to unicodedata.pyc
skipping byte-compilation of C:\Python25\lib\StringIO.py to StringIO.pyc
skipping byte-compilation of C:\Python25\lib\UserDict.py to UserDict.pyc
skipping byte-compilation of C:\Python25\lib\atexit.py to atexit.pyc
skipping byte-compilation of C:\Python25\lib\base64.py to base64.pyc
.......
.......
.......
skipping byte-compilation of C:\Python25\lib\struct.py to struct.pyc
skipping byte-compilation of C:\Python25\lib\traceback.py to traceback.pyc
skipping byte-compilation of C:\Python25\lib\types.py to types.pyc
skipping byte-compilation of C:\Python25\lib\warnings.py to warnings.pyc
*** copy extensions ***
*** copy dlls ***

*** binary dependencies ***
Your executable(s) also depend on these dlls which are not included,
you may or may not need to distribute them.

Make sure you have the license if you distribute any of them, and
make sure you don't distribute files belonging to the operating system.

   ADVAPI32.dll - C:\WINDOWS\system32\ADVAPI32.dll
   USER32.dll - C:\WINDOWS\system32\USER32.dll
   SHELL32.dll - C:\WINDOWS\system32\SHELL32.dll
   KERNEL32.dll - C:\WINDOWS\system32\KERNEL32.dll

有生成build和dist两个目录,但dist目录下只有bz2.pyd,library.zip,MSVCR71.dll,python25.dll unicodedata.pyd,w9xpopen.exe这几个文件,没有相应的exe文件生成,请问是什么回事?
*** binary dependencies ***
Your executable(s) also depend on these dlls which are not included,
you may or may not need to distribute them.

Make sure you have the license if you distribute any of them, and
make sure you don't distribute files belonging to the operating system.

   ADVAPI32.dll - C:\WINDOWS\system32\ADVAPI32.dll
   USER32.dll - C:\WINDOWS\system32\USER32.dll
   SHELL32.dll - C:\WINDOWS\system32\SHELL32.dll
   KERNEL32.dll - C:\WINDOWS\system32\KERNEL32.dll
这是表示什么意思,这几个文件在C:\WINDOWS\system32下都存在啊
“make sure you don't distribute files belonging to the operating system ”是“确保你没有发布属于操作系统的文件”?
那样怎么做才没有发布
不清楚。没试过转EXE
网上看了下。好像也有这句话。
会不会你程序有问题
from distutils.core import setup
import py2exe
setup(
    name = "delfile",
    console = ["delfile.py"],
    )

试着把安装脚本改成这样。
改了还是一样
但奇怪的是我在Script.NET里运行delfile.py时用这个提示
  File "C:/Python25/delfile.py", line 9
    os.chdir(channeldir_path)
    ^
IndentationError: unexpected indent

但是在IDLE里运行却没有任何错误提示
这是什么会事?
奇怪,应该生成一个delfile.exe才对……
错误提示是因为你缩进错了,第九行开始不应该缩进。
产生不了exe文件也可能是这个问题?不确定。
原来python还能转exe..
当然能了,不过要有python的dll来解析。

py2exe