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

Commit264e189

Browse files
try 27
1 parentdb5a076 commit264e189

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

‎27.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
importdownload_file
2-
importread_bin_file
32

43
fromPILimportImage
4+
fromPILimportImageSequence
55

66

77
defmain():
8-
url="http://www.pythonchallenge.com/pc/hex/zigzag.jpg"
9-
file_path="zigzag/zigzag.jpg"
8+
file_name="zigzag.gif"
9+
url="http://www.pythonchallenge.com/pc/hex/{}".format(file_name)
10+
file_path="zigzag/{}".format(file_name)
1011
user="butter"
1112
password="fly"
1213
# first_step(url, file_path, user, password)
13-
# second_step(file_path)
14-
third_step(file_path)
14+
second_step(file_path)
1515

1616

1717
deffirst_step(url,file_path,user,password):
1818
download_file.download_with_auth(url,file_path,user,password)
1919

2020

2121
defsecond_step(file_path):
22-
ary=read_bin_file.read_bin_file(file_path)
23-
print(ary)
24-
25-
26-
defthird_step(file_path):
2722
im=Image.open(file_path)
28-
print(im)
29-
width,height=im.size
23+
forframeinImageSequence.Iterator(im):
24+
width,height=frame.size
25+
forxinrange(width):
26+
foryinrange(height):
27+
pixel=frame.getpixel((x,y))
28+
print(pixel,end=" ")
29+
print(" ")
3030

3131

3232
if__name__=="__main__":

‎zigzag/zigzag.gif

96.4 KB
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp