wordcloud is a third-party library that can be used to generate a word cloud for a text.·With the numpy, pillow, and other third-party libraries, wordcloud can be used to analyze the content and generate a word cloud according to the weights of the words.
In this example, wordcloud is used to design a word cloud named “makeblock keywords”.
import wordcloudt = ' makeblock AI STEAM mBot Ranger Ultimate Codey halocode mBlock Neuron Laserbox' #Set the content you want to outputw = wordcloud.WordCloud(background_color='white',width = 1000,height = 1000) #Set the format of the word cloud to be generatedw.generate(t) #Select the text to be generatedw.to_file('wordcloud.png') #Set the file name and save the file to a local disk
The output of the program is as follows.

