Skip to content

Instantly share code, notes, and snippets.

@hgezim
Last active December 12, 2015 06:48
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 hgezim/4731588 to your computer and use it in GitHub Desktop.
Save hgezim/4731588 to your computer and use it in GitHub Desktop.
Python script that gets every line in every file in the current directory and appends '//' to the front.
"""Python script that gets every line in every file in the current directory and appends '//' to the front."""
import os
os.listdir('.')
file_names = os.listdir('.')
for file in file_names:
opened_file = open(file)
lines = opened_file.readlines()
for line in lines:
print "// %s" % (line),
print "\n"
opened_file.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment