'rename'에 해당되는 글 1건

  1. 2007.03.22 폴더내의 파일 이름 바꾸기
Coding/Python 삽질기2007. 3. 22. 02:10
#-*- coding: cp949 -*-
# filename : rename.py

import os
import glob
import stat
import sys

if __name__ == "__main__":

 all_flist = glob.glob ("*.py")
 
 for file in all_flist:
  if os.path.isdir(file):
   pass
 
  command = "ren %s %s_.py" % (file,  file[:-3])
  os.system(command)
  print file

'Coding > Python 삽질기' 카테고리의 다른 글

피보나치 수열 문제  (0) 2007.09.16
스도쿠 제작  (0) 2006.10.22
helloworld.cgi  (0) 2006.10.15
Posted by chobocho