Skip to content

Instantly share code, notes, and snippets.

@natecraddock
Last active April 4, 2019 22:10
Show Gist options
  • Save natecraddock/830764899b99616e953279037dce0c47 to your computer and use it in GitHub Desktop.
Save natecraddock/830764899b99616e953279037dce0c47 to your computer and use it in GitHub Desktop.
Copy all files in path to out.txt with filename headers
import os
path = "node-master"
out = open("out.txt", 'w')
for file in os.listdir(path):
in_file = open(os.path.join(path, file))
out.write(file)
out.write("\n##########################################\n")
for line in in_file.readlines():
out.write(line)
out.write("\n\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment