Commit 92deab16 by BellCodeEditor

save project

parent 39f11db6
6x2.png

125 Bytes

File added
alice.png

410 KB

bell.png

197 KB

import wordcloud
from PIL import Image
import numpy
with open('python二级考试大纲.txt',encoding='utf-8') as f:
text=f.read()
img=Image.open("bell.png")
data=numpy.array(img)
img_colors=wordcloud.ImageColorGenerator(data)
w=wordcloud.WordCloud(background_color='white',font_path="SimHei.ttf",mask=data,color_func=img_colors)
w.generate(text)
w.to_file("mycloud.png")
\ No newline at end of file
import pygame
from pygame import locals
pygame.init() # 初始化
# 创建一个窗口
screen = pygame.display.set_mode((1000, 600))
FPS = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数)
# 载入图片
background = pygame.image.load('bg.png') # 背景
road = pygame.image.load('road.png') # 路
stone = pygame.image.load('stone.png') # 石头
cacti = pygame.image.load('cacti.png') # 仙人掌
apple = pygame.image.load('bush.png'), # 灌木丛
hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero2.png'),
pygame.image.load('hero3.png'),
pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')]
index = 0
jumstate = "runing"
y = 400
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
exit()
if event.type == locals.KEYDOWN:
if event.key == locals.K_SPACE:
jumstate = "up"
if jumstate == "up":
if y > 150:
y += 5
else:
jumstate = "down"
if jumstate == "down":
if y < 400:
y += 5
else:
jumstate = "runoing"
wukong = hero[index]
index += 1
if index == 5:
index = 0
# 将背景图画上去
screen.blit(background, (0, 0))
screen.blit(road, (0, 500))
screen.blit(wukong, (150, 400))
# 刷新画面
pygame.display.update()
FPS.tick(60)
\ No newline at end of file
###基本要求
###基本要求
1.掌握 Python语言的基本语法规则。
2.掌握不少于2个基本的 Python标准库
3.掌握不少于2个 Python第三方库,掌握获取并安裝第三方库的方法。
4.能够阅读和分析 Python程序。
5.熟练使用IDLE开发环境,能够将脚本程序转变为可执行程序。
6.了解 Python计算生态在以下方面(不限于)的主要第三方库名称:网络爬虫、数据分析、数据可视化、机器学习、Web开发等。
###考试內容
一、Python语言基本语法元素
1.程序的基本语法元素:程序的格式框架、缩进、注释、变量、命名、保留字、数据类型、赋值、语句、引用
2.基本输入输出函数 input、 eval、 printO。
3.源程序的书写风格。
4. Python语言的特点。
二、基本数据类型
1.数字类型:整数类型、浮点数类型和复数类型
2.数字类型的运算:数值运算操作符、数值运算函数。
3.字符串类型及格式化:索引、切片、基本的 formato格式化方法
4.字符串类型的操作:字符串操作符、处理函数和处理方法。
5.类型判断和类型间转换。
三、程序的控制结构
1.程序的三种控制结构。
2.程序的分支结构:单分支结构、二分支结构、多分支结构
3.程序的循环结构:遍历循环、无限循环、 break和 continue循环控制。
4.程序的异常处理:try- except
四、函数和代码复用
1.函数的定义和使用
2.函数的参数传递:可选参数传递、参数名称传递、函数的返回值
3.变量的作用域:局部变量和全局变量。
五、组合数据类型
1.组合数据类型的基本概念
2.列表类型:定义、索引、切片。
3.列表类型的操作:列表的操作函数、列表的操作方法
4.字典类型:定义、索引。
5.字典类型的操作:字典的操作函数、字典的操作方法。
六、文件和数据格式化
1.文件的使用:文件打开、读写和关闭。
2.数据组织的维度:一维数据和二维数据
3.一维数据的处理:表示、存储和处理。
4.二维数据的处理:表示、存储和处理
5.采用CSⅤ格式对一二维数据文件的读写。
七、Python计算生态
1.标准库: turtle库(必选)、 random库(必选)、time库(可选)。
2.基本的 Python内置函数。
3.第三方库的获取和安装。
3.脚本程序转变为可执行程序的第三方库: Pylnstaller库(必选)。
4.第三方库: jieba库(必选) wordeloud库(可选)。
5.更广泛的 Python计算生态,只要求了解第三方库的名称,不限于以下领域:网络爬虫、数据分析、文本处理、数据可视化、用户图形界面、机器学习、Web开发、游戏开发等。
考试方式
上机考试,考试时长120分钟,满分100分。
1.题型及分值
单项选择题40分(含公共基础知识部分10分)
操作题60分(包括基本编程题和综合编程题)
2.考试环境
Windows7操作系统,建议 Python3.42至 Python3.53版本,IDLE开发环境。
\ No newline at end of file
{"第1名": 0, "第2名": 0, "第3名": 0}
\ No newline at end of file
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