Commit e0e23529 by BellCodeEditor

auto save

parent fd1c0489
import wordcloud import wordcloud
from PIL import Image
import numpy
import jieba
with open('python二级考试大纲.txt','r',encoding='utf-8') as f:
text = f.read()
txt_list = jieba.lcut(text)
text = " ".join(txt_list)
img = Image.open("bell.png")
data = numpy.array(img)
img_colors = wordcloud.ImageColorGenerator(data)
stopwords = ["的","python","和","基本","程序"]
w = wordcloud.WordCloud(background_color="white",
font_path='SimHei.ttf',
mask=data,color_func=img_colors,
stopwords=stopwords,max_font_size=60)
w.generate(text)
w.to_file("mycloud.png")
###基本要求 ###基本要求
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
3.掌握不少于2个 Python第三方库,掌握获取并安裝第三方库的方法。 3.掌握不少于2个 Python第三方库,掌握获取并安裝第三方库的方法。
4.能够阅读和分析 Python程序。 4.能够阅读和分析 Python程序。
5.熟练使用IDLE开发环境,能够将脚本程序转变为可执行程序。 5.熟练使用IDLE开发环境,能够将脚本程序转变为可执行程序。
6.了解 Python计算生态在以下方面(不限于)的主要第三方库名称:网络爬虫、数据分析、数据可视化、机器学习、Web开发等。 6.了解 Python计算生态在以下方面(不限于)的主要第三方库名称:李信yyds、网络爬虫、数据分析、数据可视化、机器学习、Web开发等。
###考试內容 ###考试內容
一、Python语言基本语法元素 一、Python语言基本语法元素
1.程序的基本语法元素:程序的格式框架、缩进、注释、变量、命名、保留字、数据类型、赋值、语句、引用 1.程序的基本语法元素:程序的格式框架、缩进、注释、变量、命名、保留字、数据类型、赋值、语句、引用
......
import wordcloud
from PIT import Image
import numpy
import jieba
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment