Skip to content

Instantly share code, notes, and snippets.

@afjk
Created June 21, 2013 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afjk/5831362 to your computer and use it in GitHub Desktop.
Save afjk/5831362 to your computer and use it in GitHub Desktop.
指定フォルダ以下の指定拡張子のファイルリストを表示
# -*- 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