Skip to content

Instantly share code, notes, and snippets.

@timkofu
Created January 13, 2020 11:19
Show Gist options
  • Save timkofu/e0476f27e748e73c59b5ceca3ee8d06b to your computer and use it in GitHub Desktop.
Save timkofu/e0476f27e748e73c59b5ceca3ee8d06b to your computer and use it in GitHub Desktop.
import random
from wordcloud import WordCloud
import matplotlib.pyplot as plt
word_cloud_text = []
for word in ['Rust','Go','Java','C++', 'Erlang','D', 'Python']:
for _ in range(random.randint(1000, 10000)):
word_cloud_text.append(word)
word_cloud = WordCloud().generate(' '.join(word_cloud_text))
image = word_cloud.to_image()
#print(help(image.save))
image.save("img.png")
# plt.imshow(wordcloud, interpolation='bilinear')
# plt.axis("off")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment