单选题

阅读以下代码,描述错误的选项是?( )

import wordcloud
txt="Nothing is impossible!"
w=wordcloud.WordCloud(background_color="white")
w.generate(txt)
w.to_file('px.png')

A

wordcloud.WordCloud()代表一个文本对应的词云

B

w.generate(txt)为向WordCloud对象中加载文本txt

C

w.to_file(filename)将词云输出为图像文件,只能输出为.png格式

D

background_color指定词云图片的背景颜色,默认为黑色

赣ICP备20007335号-2