my_cloud.py 219 Bytes Edit 1 2 3 4 5 6 7 8 import wordcloud with open("python二级考试大纲.txt","r",encoding="utf-8") as f: txt=f.read() w=wordcloud.WordCloud(background_color="red",font_path="SimHei.ttf") w.generate(txt) w.to_file("mycol.png")