- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path29.py
More file actions
Latest commit
36 lines (28 loc) · 814 Bytes
/
Copy path29.py
File metadata and controls
36 lines (28 loc) · 814 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
26
27
28
29
30
31
32
33
34
35
36
importdownload_file
importbz2
defmain():
url="http://www.pythonchallenge.com/pc/ring/guido.html"
file_path="silent/guido.html"
user="repeat"
password="switch"
# first_step(url, file_path, user, password)
second_step(file_path)
deffirst_step(url, file_path, user, password):
download_file.download_with_auth(url, file_path, user, password)
defsecond_step(file_path):
file=open(file_path, "r")
count=0
result=""
whileTrue:
count+=1
line=file.readline()
ifline:
ifcount>=13:
result+=chr(len(line) -1)
else:
break
print("result = "+result)
dec_result=bz2.decompress(result.encode("latin1"))
print(dec_result)
if__name__=="__main__":
main()