Changes between Initial Version and Version 1 of FileServer/listing/rename.py
- Timestamp:
- 05/27/2011 11:12:29 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FileServer/listing/rename.py
v1 v1 1 {{{ 2 #!py 3 4 5 #!/usr/bin/env python 6 7 # for more detail, see http://docs.python.org/ 8 9 import os 10 11 files = [] 12 for i in os.listdir("."): 13 if i.endswith(".png"): 14 files.append(i) 15 16 idx = 0 17 for j in files: 18 oldFilename = j 19 newFilename = "%d.png" % idx 20 os.rename(oldFilename, newFilename) 21 idx += 1 22 23 }}}
![(please configure the [header_logo] section in trac.ini)](http://www1.pconline.com.cn/hr/2009/global/images/logo.gif)