From StackOverflow
def stripped(f):
for l in f:
line = l.rstrip()
if line and not line.startswith("#"):
yield line
with(open "foo.txt", "r") as f:
for line in stripped(f):
print line
This is my blog. There are many like it, but this one is mine.
From StackOverflow
def stripped(f):
for l in f:
line = l.rstrip()
if line and not line.startswith("#"):
yield line
with(open "foo.txt", "r") as f:
for line in stripped(f):
print line
Posted in Uncategorized.
– September 6, 2011
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.