Skip to content

Instantly share code, notes, and snippets.

@hgezim hgezim/comment_cwd.py
Last active Dec 12, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.