Commit 4532951f by BellCodeEditor

save project

parent ad744d92
import wordcloud
from tkinter import filedialog,Tk
from PIL import Image
root = Tk()
root.withdraw()
path = filedialog.askopenfilenames(title="选择图片文件",)
filetypes=[("All Files","*")],
initialdir="./")
img_list = []
for i in path:
img = Image.open(i)
img_list.append(img)
with open("python二级考试大纲.txt",encoding='utf-8') as f:
text = f.read()
img_list[0].save("bot.gif",save_all=True,
append_images=img_list[1:])
# print(path)
# import turtas t
# times = 12
# angle = 360le / times
# t.hideturtle()
# t.pencolor("red")
# t.penup()
# t.goto(0, -120)
# t.pendown()
# t.circle(120)
# t.penup()
# t.home()
# t.color("black", "yellow")
# for i in range(times):
# t.seth(angle * i)
# t.penup()
# t.forward(120)
# t.pendown()
# t.begin_fill()
# t.left(30)
# t.forward(80)
# t.right(60)
# t.forward(80)
# t.right(120)
# t.forward(80)
# t.right(60)
# t.forward(80)
# t.end_fill()
# # 回原点
# t.penup()
# t.home()
# t.done
w = wordcloud.wordcloud(background_color='white'
# 2
# import turtle as t
# t.seth(90)
# t.left(30)
# t.forward(60)
# t.backward(60)
# t.right(60)
# t.forward(60)
# t.backward(60)
# t.left(30)
# t.done()
# 3
# nums=[int(x)for xin input().split(',')]
# mx = max(nums)
# mn = min(nums)
# avg =sum(nums)/len(nums)
# print(mx)print(mn)
# print(avg)
# 4
# n = int(input("请输入一个小于1000的自然数"))
# for i in range(n):
# if "3" in str(i):
# print(i)
# 5
# n = int(input())
# s=1
# for i in range(n):
# print(" "*(n-1)"*"*s)
# s+=2
# import wordcloud
# with open("python二级考试大纲.txt",encoding='utf-8') as f:
# text = f.read()
# txt_list = jieba.lcut(text)
# text = " ".join(txt_list)
# img = Image.open("bell.png")
# data = numerator()
# w = wordcloud.wordcloud(background_color='white',
# font_path='SimHei.ttf',
# mask=data,color_func=ing_colors)
# # import wordcloud
# w = wordcloud.wordcloud(backg)
# w.generate("hello word")
# w.to_file("myclod")
......
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