-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path5.py
More file actions
25 lines (20 loc) · 729 Bytes
/
5.py
File metadata and controls
25 lines (20 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import requests
import pickle
from bs4 import BeautifulSoup, Comment
import re
characters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
'v', 'w', 'x', 'y', 'z']
big_characters = [c.upper() for c in characters]
characters += big_characters
reg = r'[a-z][A-Z][A-Z][A-Z]([a-z])[A-Z][A-Z][A-Z][a-z]'
url = 'http://www.pythonchallenge.com/pc/def/banner.p'
if __name__ == '__main__':
r = requests.get(url)
print(r.content)
uniq_res = []
with open('banner.p', 'wb') as f:
f.write(r.content)
with open('banner.p', 'rb') as f:
res = pickle.load(f)
for r in res:
print(''.join([elem[1]*elem[0] for elem in r]))