Skip to content

Instantly share code, notes, and snippets.

@frknozr frknozr/
Created Jun 23, 2017

What would you like to do?
#!/usr/bin/env python
import sys
def with_file(filename):
with open(filename) as f: lines = [line.rstrip('\n') for line in f]
for line in lines:
print line
print line.title()
def with_stdin(data):
for line in data:
print line
print line.title()
if len(sys.argv) > 1:
data = [line.replace("\n","") for line in sys.stdin.readlines()]#problem
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.