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