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
46bb3ea9
authored
Dec 10, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
14e32fa1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
43 deletions
d.py
dd.py/ddd.py
take out and in.py
xbots.gif
朕.py
d.py
View file @
46bb3ea9
from
tkinter
import
filedialog
,
Tk
#导入tk模块里的文件处理小模块
from
PIL
import
Image
#导入PIL中的Image功能
root
=
Tk
()
#使用tk模块赋值给root对象
root
.
withdraw
()
#消除tk模块自带的小窗口
path
=
filedialog
.
askopenfilenames
(
title
=
'选择图片文件'
,
#使用文件处理模块
#选择多个图片
filetypes
=
[(
'png'
,
'png'
)],
initialdir
=
"./"
)
img_list
=
[]
for
i
in
path
:
img
=
Image
.
open
(
i
)
img_list
.
insert
(
0
,
img
)
print
(
img_list
)
img_list
[
0
]
.
save
(
"xbots.gif"
,
save_all
=
True
,
append_images
=
img_list
[
1
:])
\ No newline at end of file
ai
=
list
(
map
(
int
,
input
()
.
split
(
" "
)))
for
i
in
range
(
len
(
ai
)
-
2
,
-
1
,
-
1
):
print
(
ai
[
i
],
end
=
' '
)
\ No newline at end of file
dd.py/ddd.py
View file @
46bb3ea9
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
n
=
int
(
input
())
list
=
[
n
]
while
n
!=
1
:
if
n
%
2
==
0
:
n
=
n
/
2
list
.
append
(
int
(
n
))
else
:
n
=
n
*
3
+
1
list
.
append
(
int
(
n
))
list1
=
list
[::
-
1
]
for
i
in
list1
:
print
(
i
,
end
=
' '
)
\ No newline at end of file
take out and in.py
View file @
46bb3ea9
from
PIL
import
Image
,
ImageSequence
im
=
Image
.
open
(
'dive.gif'
)
num
=
0
for
i
in
ImageSequence
.
Iterator
(
im
):
i
.
save
(
'turn/'
+
str
(
num
)
+
'.png'
)
num
+=
1
\ No newline at end of file
n
=
int
(
input
())
tr
=
[[
1
],[
1
,
1
]]
for
i
in
range
(
2
,
n
):
pre
=
tr
[
i
-
1
]
frist
=
[
1
]
for
j
in
range
(
i
-
1
):
frist
.
append
(
pre
[
j
]
+
pre
[
j
+
1
])
frist
.
append
(
1
)
tr
.
append
(
frist
)
for
a
in
range
(
n
):
s
=
" "
*
(
n
-
a
-
1
)
for
b
in
tr
[
a
]:
s
=
s
+
str
(
b
)
+
" "
print
(
s
)
\ No newline at end of file
xbots.gif
View file @
46bb3ea9
This diff is collapsed.
Click to expand it.
朕.py
View file @
46bb3ea9
from
PIL
import
Image
,
ImageSequence
import
csv
from
PIL
import
Image
,
ImageSequence
import
csv
img
=
Image
.
open
(
'dive.gif'
)
num
=
0
for
i
in
ImageSequence
.
Iterator
(
img
):
i
.
save
(
'img/'
+
str
(
num
)
+
'.png'
)
#这里把分解到的每一张静态
num
+=
1
\ No newline at end of file
data
=
[
95
,
92
,
94
]
\ 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