猫史档案馆


Python-如何救起落水帅哥☺

用户:炽热未来炽热未来查看:0 回复:7 评论:0 创建时间:2020-04-08T16:25:30


 

center_image

帅哥:救命啊!救命啊!

我:呃呃呃...这位“衰”哥,请问你要去哪?emotion_编程猫_翻白眼

衰哥:......快......快救救我......(咕噜咕噜咕噜咕噜......)

我:emotion_编程猫_紧张

神秘人:兄嘚,遇到凡事不要慌,Python大神帮你解决!玛喵尼哄!!!!!

center_image
(如果看这幅图不会动,可能是作者电脑爆了。)

from PIL import Image,ImageSequence
#需要先下载pillow库。
#打开终端输入:pip install pillow
h=Image.open('你想要的文件的名字,后缀名要是.gif')
#利用open函数来打开你想要的文件的名字。
if h.is_animated:
	z=[]
	for f in ImageSequence.Iterator(h):
			f=f.copy()
			z.append(f)
#提取每一帧图片。
	z.reverse()
#倒放
	z[0].save("out.gif",save_all=True,append_images=z[1:])
#完成!

emotion_编程猫_冷漠emotion_编程猫_冷漠emotion_编程猫_冷漠emotion_编程猫_冷漠emotion_编程猫_冷漠emotion_编程猫_冷漠emotion_编程猫_冷漠
我:呵呵呵,劳资也会。G~U~N——滚

 

神秘人:

emotion_编程猫_耍赖emotion_编程猫_耍赖emotion_编程猫_伤心emotion_编程猫_伤心emotion_编程猫_伤心

我:☠

神秘人:emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了

   大哥,给个赞呗?                                                                                                                                           emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了


回复

上一页1 页 / 共 1下一页
S喵基金会会长S喵基金会会长

......

点赞1


评论


名字是什么a名字是什么a

emotion_编程猫_溜了溜了

点赞1


评论


無一郎無一郎

emotion_编程猫_冷漠

点赞2


评论


炽热未来炽热未来

center_image

点赞0


评论


炽热未来炽热未来

center_image

                                                                           笑容逐渐喵

emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了emotion_编程猫_溜了溜了

点赞0


评论


炽热未来炽热未来

buxiang='不要不要不要不要不要不要不要不要'
for i in buxiang:
    if i == '不':
        print("要代码吗?")
    else:
        print("要才怪了")

center_image

buxiang='不要不要不要不要不要不要不要不要'
for i in buxiang:
    if i == '不':
        print("要代码吗?")
    else:
        print("要才怪了")

点赞1


评论


炽热未来炽热未来

from PIL import Image,ImageFont,ImageDraw
import random
s=random.randint(1,100)
ss=random.randint(1,100)
x=-100
sss=random.randint(1,100)
img=Image.open("图片1.png")
face=Image.open("图片2.png")
face=face.resize((113,127))
width=face.size[0]
height=face.size[1]
img.paste(face,(130,170,130+width,170+height))
font_set=ImageFont.truetype("msyh.ttc",25)
draw=ImageDraw.Draw(img)
for i in range(1400):
    s=random.randint(1,100)
    ss=random.randint(1,100)
    sss=random.randint(1,100)
    draw.text((1,x),"满头彩线满头彩线满头彩线满头彩线满头彩线满头彩线满头彩线满头彩线",fill=(s,ss,sss),font=font_set)
    draw.text((1,x),"满头彩线满头彩线满头彩线满头彩线满头彩线满头彩线满头彩线满头彩线",fill=(s,ss,sss),font=font_set)

    x=x+1
draw.text((430,100),"满",fill=(0,0,0),font=font_set)
draw.text((430,150),"头",fill=(0,0,0),font=font_set)
draw.text((430,200),"彩",fill=(0,0,0),font=font_set)
draw.text((430,250),"线",fill=(0,0,0),font=font_set)

img.show()
img.save("result.png")

运行一下看看。

点赞2


评论