Skip to content

Instantly share code, notes, and snippets.

@yomusu
Created October 12, 2011 06:02
Show Gist options
  • Save yomusu/1280407 to your computer and use it in GitHub Desktop.
Save yomusu/1280407 to your computer and use it in GitHub Desktop.
Pythonのファイル操作
import os
# 現在のディレクトリ
os.getcwd()
# ファイル名連結
os.path.join( "dir", "sub" )
import os
for root,dirs,files in os.walk("."):
for file in files:
filepath = os.path.join( root, file )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment