Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a8de9e2

Browse filesBrowse files
solved 29
1 parent c8b09f0 commit a8de9e2
Copy full SHA for a8de9e2

File tree

3 files changed

+125
-0
lines changed
Filter options

3 files changed

+125
-0
lines changed

‎29.py

Copy file name to clipboard
+36Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import download_file
2+
import bz2
3+
4+
5+
def main():
6+
url = "http://www.pythonchallenge.com/pc/ring/guido.html"
7+
file_path = "silent/guido.html"
8+
user = "repeat"
9+
password = "switch"
10+
# first_step(url, file_path, user, password)
11+
second_step(file_path)
12+
13+
14+
def first_step(url, file_path, user, password):
15+
download_file.download_with_auth(url, file_path, user, password)
16+
17+
18+
def second_step(file_path):
19+
file = open(file_path, "r")
20+
count = 0
21+
result = ""
22+
while True:
23+
count += 1
24+
line = file.readline()
25+
if line:
26+
if count >= 13:
27+
result += chr(len(line) - 1)
28+
else:
29+
break
30+
print("result = " + result)
31+
dec_result = bz2.decompress(result.encode("latin1"))
32+
print(dec_result)
33+
34+
35+
if __name__ == "__main__":
36+
main()

‎README.md

Copy file name to clipboardExpand all lines: README.md
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# pythonchallenge
22
Solve Problems in http://www.pythonchallenge.com
33

4+
#### 29
5+
result: http://www.pythonchallenge.com/pc/ring/yankeedoodle.html
6+
- do you find these unnecessary empty lines in the source page of guido.html
7+
8+
49
#### 28
510
result: http://www.pythonchallenge.com/pc/ring/guido.html
611
- use image.split() to split RGB channels

‎silent/guido.html

Copy file name to clipboard
+84Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<html>
2+
<head>
3+
<title>silence!</title>
4+
<link rel="stylesheet" type="text/css" href="../style.css">
5+
</head>
6+
<body>
7+
<br><br>
8+
<center>
9+
<font color="gold">
10+
<img src="whoisit.jpg" border="0"/>
11+
</body>
12+
</html>
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+
42+
43+
44+
45+
46+
47+
48+
49+
50+
51+
52+
53+
54+
55+
56+
57+
58+
59+
60+
61+
62+
63+
64+
65+
66+
67+
68+
69+
70+
71+
72+
73+
74+
75+
76+
77+
78+
79+
80+
81+
82+
83+
84+

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.