Python词云
pip install wordcloud
from wordcloud import WordCloud
import numpy as np
from PIL import Image
wcd = WordCloud(backgound_color="white",repeat=True,max_words=100,height=480,width=800,max_font_size=100,font_pant="fonts/msyh.ttc",colormap="Reds",mask=mask)
mask = np.array(Image.open("xxxx.png"))
text = "富强、民主、文明、和谐,倡导自由、平等、公正、法治,倡导爱国、敬业、诚信、友善"
wcd.generate(text)
wcd.to_image()
wcd.to_file("China.png")