Created
April 14, 2017 11:23
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from urllib.request import urlopen | |
def fetch_words(url): | |
words = [] | |
with urlopen(url) as f: | |
for line in f: | |
for word in line.decode('utf-8').split(): | |
words.append(word) | |
return words | |
def print_items(items): | |
for item in items: | |
print(item) | |
def main(url): | |
print_items(fetch_words(url)) | |
if(__name__ == "__main__"): | |
main(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment