File tree 2 files changed +12
-12
lines changed
2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 1
1
import download_file
2
- import read_bin_file
3
2
4
3
from PIL import Image
4
+ from PIL import ImageSequence
5
5
6
6
7
7
def main ():
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 )
10
11
user = "butter"
11
12
password = "fly"
12
13
# first_step(url, file_path, user, password)
13
- # second_step(file_path)
14
- third_step (file_path )
14
+ second_step (file_path )
15
15
16
16
17
17
def first_step (url , file_path , user , password ):
18
18
download_file .download_with_auth (url , file_path , user , password )
19
19
20
20
21
21
def second_step (file_path ):
22
- ary = read_bin_file .read_bin_file (file_path )
23
- print (ary )
24
-
25
-
26
- def third_step (file_path ):
27
22
im = Image .open (file_path )
28
- print (im )
29
- width , height = im .size
23
+ for frame in ImageSequence .Iterator (im ):
24
+ width , height = frame .size
25
+ for x in range (width ):
26
+ for y in range (height ):
27
+ pixel = frame .getpixel ((x , y ))
28
+ print (pixel , end = " " )
29
+ print (" " )
30
30
31
31
32
32
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments