Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

Commita8de9e2

Browse files
solved 29
1 parentc8b09f0 commita8de9e2

File tree

3 files changed

+125
-0
lines changed

3 files changed

+125
-0
lines changed

‎29.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
importdownload_file
2+
importbz2
3+
4+
5+
defmain():
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+
deffirst_step(url,file_path,user,password):
15+
download_file.download_with_auth(url,file_path,user,password)
16+
17+
18+
defsecond_step(file_path):
19+
file=open(file_path,"r")
20+
count=0
21+
result=""
22+
whileTrue:
23+
count+=1
24+
line=file.readline()
25+
ifline:
26+
ifcount>=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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#pythonchallenge
22
Solve Problems inhttp://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

Lines 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+
<linkrel="stylesheet"type="text/css"href="../style.css">
5+
</head>
6+
<body>
7+
<br><br>
8+
<center>
9+
<fontcolor="gold">
10+
<imgsrc="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)

[8]ページ先頭

©2009-2025 Movatter.jp