just print contents
variable where you want.
Last active
November 22, 2015 14:36
-
-
Save shavidzet/21fae8b2c72703c00b5b to your computer and use it in GitHub Desktop.
The following algorithm help us to handle directory files whole content
This file contains hidden or 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 | |
path = "./data"; | |
contents = "" | |
for path,dirs,files in os.walk(path): | |
for fn in files: | |
with open(os.path.join(path,fn)) as f: contents += f.read() | |
#print os.path.join(path,fn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment