Ubuntu的默认中文是哪种呢?

fc-list :lang=zh 

用这个命令查看出来

NotoSerifCJK-Bold.ttc

为什么要知道这个呢?

来看一块python3代码


import jieba
import wordcloud

f = open("threekingdom.txt","rb")
t = f.read()
f.close()
ls = jieba.lcut(t)
txt = " ".join(ls)
w = wordcloud.WordCloud(    
						font_path = "NotoSerifCJK-Bold.ttc",\
                        width = 1000,height = 700,background_color = "white",\
                       )   

w.generate(txt)
w.to_file("gr.png")

然后发生了什么呢?

python的词云分析

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2021-11-28
  • 2021-05-06
  • 2021-05-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2022-12-23
  • 2021-08-04
  • 2022-03-12
  • 2022-01-24
相关资源
相似解决方案