@howardderekl/

aBetterWayToLearnPython

Python

A Better Way to Learn Python Practice Files

fork
loading
Files
  • main.py
  • Decorators.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.3249032086857855","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"ZnJvbSB1cmxsaWIucmVxdWVzdCBpbXBvcnQgdXJsb3BlbgoKd2l0aCB1cmxvcGVuKCdodHRwOi8vc2l4dHktbm9ydGguY29tL2MvdC50eHQnKSBhcyBzdG9yeToKICAgIHN0b3J5X3dvcmRzID0gW10KICAgIGZvciBsaW5lIGluIHN0b3J5OgogICAgICAgIGxpbmVfd29yZHMgPSBsaW5lLmRlY29kZSgndXRmLTgnKS5zcGxpdCgpCiAgICAgICAgZm9yIHdvcmQgaW4gbGluZV93b3JkczoKICAgICAgICAgICAgc3Rvcnlfd29yZHMuYXBwZW5kKHdvcmQpCgpmb3Igd29yZCBpbiBzdG9yeV93b3JkczoKICAgIHByaW50KHdvcmQpCg=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
from urllib.request import urlopen

with urlopen('http://sixty-north.com/c/t.txt') as story:
    story_words = []
    for line in story:
        line_words = line.decode('utf-8').split()
        for word in line_words:
            story_words.append(word)

for word in story_words:
    print(word)