Skip to content

Commit fd5e908

Browse files
committed
Chapter 8 - Py4e
1 parent fc37258 commit fd5e908

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ex_8_0_6.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
fhand = open('mbox-short.txt')
2+
for line in fhand:
3+
line = line.rstrip()
4+
if not line.startswith('From '): continue
5+
words = line.split()
6+
print(words[2])
7+
emails = words[1]
8+
pieces = emails.split('@')
9+
print(pieces[1])

0 commit comments

Comments
 (0)