Created
October 12, 2011 06:02
-
-
Save yomusu/1280407 to your computer and use it in GitHub Desktop.
Pythonのファイル操作
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# 現在のディレクトリ | |
os.getcwd() | |
# ファイル名連結 | |
os.path.join( "dir", "sub" ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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