- 论坛徽章:
- 0
|
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文件生成,请问是什么回事? |
|