Commit cb87c3e5 by BellCodeEditor

auto save

parent 7ec5ea29
Showing with 12 additions and 1 deletions
...@@ -11,4 +11,14 @@ path=filedialog.askopenfilenames(title='选择图片文件', ...@@ -11,4 +11,14 @@ path=filedialog.askopenfilenames(title='选择图片文件',
filetypes=[('png','.png')], filetypes=[('png','.png')],
initialdir='./') initialdir='./')
print(path) #生成GIF动图
img_list=[] # 建立空列表
for i in path: # for循环遍历变量path提取变量i
# Image.open()方法参数为i赋值给变量img
img = Image.open(i)
# 列表名.append()方法参数为img
img_list.append(img)
# 列表img_list[0].save()方法
# 参数1文件命名,参数2save_all设为True,参数3append_images设为img_list[1:]取出第二到结尾所有图片
img_list[0].save("bot.gif",save_all=True,
append_images=img_list[1:])
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment