编辑main.py,写入如下代码:
import wordcloud
word = wordcloud.WordCloud().generate(
'''
When I do count the clock that tells the time,
And see the brave day sunk in hideous night;
When I behold the violet past prime,
And sable curls all silver'd o'er with white:
When lofty trees I see barren of leaves,
Which erst from heat did canopy the herd,
And summer's green, all girded up in sheaves,
Born on the bier with white and bristly beard;
Then of thy beauty do I question make,
That thou among the wastes of time must go,
Since sweets and beauties do themselves forsake,
And die as fast as they see others grow;
And nothing 'gainst Time's scythe can make defence
Save breed, to brave him when he takes thee hence.
'''
) # 三引号之间的文本,换成你想要的文本
pic = word.to_image()
pic.show()