Created
June 21, 2013 14:01
-
-
Save afjk/5831362 to your computer and use it in GitHub Desktop.
指定フォルダ以下の指定拡張子のファイルリストを表示
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
# -*- coding: CP932 -*- | |
# 指定フォルダ以下の指定拡張子のファイルリストを表示 | |
import re | |
import os | |
def main(): | |
print os.path.realpath(".") | |
for root, dirs, files in os.walk(r"D:¥work¥src"): | |
for fname in files: | |
if( fname[-4:] == ".cpp" ) or ( fname[-2:] == ".c" ) or ( fname[-2:] == ".h" ): | |
print os.path.join(root, fname) | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment