Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

Administrator / level3-lesson22-diy1

  • This project
    • Loading...
  • Sign in
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
Switch branch/tag
  • level3-lesson22-diy1
  • d.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    save project · 13c82b2e
    BellCodeEditor committed a year ago
    13c82b2e
d.py 752 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
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:])