컴퓨터/Python

Python]Get child directory

예섬수진 2009. 10. 9. 16:15
특정 폴더의 바로 밑에 해당하는 폴더명 구하기

 for sub_path in os.listdir(rc_result_folder):
  sub_dir = os.path.join(rc_result_folder, sub_path)
  if os.path.isdir(sub_dir):
   print 'rc model = ' + sub_dir
   # end of if
 # end of for