Skip to content

Instantly share code, notes, and snippets.

@dukenmarga
Created August 19, 2014 04:40
Show Gist options
  • Save dukenmarga/9183706675ad5e87e8de to your computer and use it in GitHub Desktop.
Save dukenmarga/9183706675ad5e87e8de to your computer and use it in GitHub Desktop.
read file line per line and trim new line symbol
file = 'fileName'
f = open(file, 'r')
content = f.readlines()
size = len(content)
for i in range(size):
print content[i].rstrip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment