Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson22-diy1
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
fe536084
authored
Oct 21, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
4a991988
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
d.py
d.py
View file @
fe536084
from
tkinter
import
filedialog
,
Tk
from
PIL
import
Image
from
tkinter
import
filedialog
,
Tk
#导入tk模块里的文件处理小模块
from
PIL
import
Image
#导入PIL中的Image功能
root
=
Tk
()
root
.
withdraw
()
path
=
filedialog
.
askopenfilenames
(
title
=
'选择图片文件'
,
filetypes
=
[(
'
ALL Files'
,
'*'
)],
root
=
Tk
()
#使用TK模块赋值给root对象
root
.
withdraw
()
#消除tk模块自带的小窗口
path
=
filedialog
.
askopenfilenames
(
title
=
'选择图片文件'
,
#使用文件处理模块
filetypes
=
[(
'
peg'
,
'.peg'
)],
#选的多个图片
initialdir
=
"./"
)
img_list
=
[]
for
i
in
path
:
img
=
image
.
open
(
1
)
img_list
.
insert
(
0
,
img
)
img_list
.
insert
(
img
)
img_list
[
0
]
.
save
(
"bot.gif"
,
save_all
=
True
,
append_images
=
img_list
[
1
:])
\ No newline at end of file
append_images
=
img_list
[
1
:])
\ No newline at end of file
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