Commit 30127499 by BellCodeEditor

save project

parent 9ff7c007
import jieba
text = "你在桥上看风景,看风景人在楼上看你。明月装饰了你的窗子,你装饰了别人的梦"
txt_list = jieba.lcut(text)
print(txt_list)
\ No newline at end of file
import wordcloud
from PIL import Image
import numpy as np
import jieba
with open('桃园三结义.txt',encoding='utf-8')as f:
text = f.read()
txt_list = jieba.lcut(text)
text = " ".join(txt_list)
img = Image.open("bell.png")
value = np.array(img)
image_colors = wordcloud.ImageColorGenerator(value)
w = wordcloud.WordCloud(background_color="white",mask=value,
font_path='SimHei.ttf',color_fonc=image_colors,
max_font_size=60)
w.generate(text)
w.to_file("mycloud.png")
from tkinter import filedialog,Tk
root = Tk()
root.withdraw()
path = filedialog.askopenfilenames(title='选择图片文件',
filetypes=[('png','.png')],
initialdir="./")
print(path)
\ No newline at end of file
from PIL import Image,ImageSequence
img = Image.open("xxx.gif")
num = 0
for i in ImageSequence.Iterator(img):
i.save(r"img/"+str(num)+".png")
num += 1
\ No newline at end of file
class Hero:
def __init__(self):
self.leve =1
self.hp= 300
self.attack= 20
yase = Hero()
print("yase的血量值为:",yase.hp)
print("yase的攻击力为:",yase.attack)
from PIL import Image
import numpy
img = Image.Open("apple.png")
data = numpy.array(img)
print(data)
\ No newline at end of file
import func
data = func.new_input()
score = func.sum(data)
print("总分:"+str(score))
\ No newline at end of file
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