diff --git a/diy3.py b/diy3.py index f1d55f4..5ae8e68 100644 --- a/diy3.py +++ b/diy3.py @@ -1,10 +1,6 @@ -message = "诺依,周末一起去看动漫展吧!" - -# 请使用索引的知识,取出message所有元素(不用遍历的方式) -for i in message: - str1 = i - str2 = random.choice(Key) - str3 = random.choice(key) - text = str1+str2+str3 - key_message=key_message+text -print(key_message) \ No newline at end of file +import wordcloud +with open('python二级考试大纲.txt',encoding='utf-8')as f: + text=f.read() +w=wordcloud.WordCloud(background_color="white",font_path="SinHei.ttf") +w.generate(text) +w.to_file("my_cloud.png") \ No newline at end of file