【问题标题】:How do I open a gif in Python?如何在 Python 中打开 gif?
【发布时间】:2014-05-12 18:39:44
【问题描述】:

我想知道是否可以使用 Python 播放动画 gif。我只想显示一组并以一定的间隔进行迭代。我想知道在 python 中打开它们的最佳途径是什么。是否可以使用 Preview(我使用的是 Mac)或 Web 浏览器包打开?

【问题讨论】:

  • import webbrowser; webbrowser.open('file:///path/to/image.gif')

标签: python python-2.7 gif animated-gif


【解决方案1】:

您可以使用 python 中的 Tkinter 库来执行此操作。您甚至可以添加按钮、标签等。

更多信息:

https://docs.python.org/2/library/tkinter.html#a-simple-hello-world-program

http://effbot.org/tkinterbook/photoimage.htm

【讨论】:

  • PhotoImage 适用于 gif,但它适用于 animated gif 吗?
猜你喜欢
  • 2016-03-19
  • 2020-04-21
  • 2022-01-15
  • 2014-03-26
  • 1970-01-01
  • 2021-03-18
  • 2020-01-22
  • 2021-09-22
  • 1970-01-01
相关资源
最近更新 更多