Skip to content

Commit 8cbb203

Browse files
committed
2 parents 2aeb52f + 6eb14ca commit 8cbb203

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

xianhuan/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Python技术 公众号文章代码库
1010

1111
## 实例代码
1212

13+
[卧槽!几行代码,干掉一个网站!](https://github.com/JustDoPython/python-examples/tree/master/xianhuan/gengif):卧槽!几行代码,干掉一个网站!
14+
1315
[牛逼!用Python为她设计专属签名软件](https://github.com/JustDoPython/python-examples/tree/master/xianhuan/artname):牛逼!用Python为她设计专属签名软件
1416

1517
[利用搜索指数窥探舆情](https://github.com/JustDoPython/python-examples/tree/master/xianhuan/bdindex):利用搜索指数窥探舆情

xianhuan/gengif/gengif.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
"""
4+
@author: 闲欢
5+
"""
6+
# coding:utf-8
7+
import os
8+
from PIL import Image
9+
10+
imgFolderPath = "C:\\Users\\xxx\\Downloads\\imgs"
11+
fileList = os.listdir(imgFolderPath)
12+
firstImgPath = os.path.join(imgFolderPath, fileList[0])
13+
im = Image.open(firstImgPath)
14+
images = []
15+
for img in fileList[1:]:
16+
imgPath = os.path.join(imgFolderPath, img)
17+
images.append(Image.open(imgPath))
18+
im.save('C:\\Users\\xxx\\Downloads\\imgs\\beauty.gif', save_all=True, append_images=images, loop=0, duration=500)

0 commit comments

Comments
 (0)