Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson22-diy2
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e7d2e80e
authored
Oct 21, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
125f7763
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
4 deletions
bot.gif
d.py
dd.py/ddd.py
dive.gif
bot.gif
View file @
e7d2e80e
This diff is collapsed.
Click to expand it.
d.py
View file @
e7d2e80e
...
...
@@ -4,13 +4,13 @@ from PIL import Image #导入PIL中的Image功能
root
=
Tk
()
#使用TK模块赋值给root对象
root
.
withdraw
()
#消除tk模块自带的小窗口
path
=
filedialog
.
askopenfilenames
(
title
=
'选择图片文件'
,
#使用文件处理模块
filetypes
=
[(
'p
ng'
,
'.pn
g'
)],
#选的多个图片
filetypes
=
[(
'p
eg'
,
'.pe
g'
)],
#选的多个图片
initialdir
=
"./"
)
img_list
=
[]
for
i
in
path
:
img
=
Image
.
open
(
i
)
img_list
.
insert
(
0
,
img
)
img
=
image
.
open
(
1
)
img_list
.
insert
(
img
)
img_list
[
0
]
.
save
(
"
dive
.gif"
,
save_all
=
True
,
img_list
[
0
]
.
save
(
"
bot
.gif"
,
save_all
=
True
,
append_images
=
img_list
[
1
:])
\ No newline at end of file
dd.py/ddd.py
0 → 100644
View file @
e7d2e80e
from
PIL
import
Image
,
ImageSequence
img
=
Image
.
open
(
'dive.gif'
)
num
=
0
for
i
in
ImageSequence
.
Iterator
(
img
):
i
.
save
(
r'./img'
+
str
(
num
)
+
'.png'
)
num
+=
1
\ No newline at end of file
dive.gif
View file @
e7d2e80e
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment