摘要: PIL库主要有2个方面的功能: (1) 图像归档:对图像进行批处理、生产图像预览、图像格式转换等。 (2) 图像处理:图像基本处理、像素处理、颜色处理等。 阅读全文
posted @ 2020-05-06 22:50 ikome 阅读(118) 评论(0) 推荐(0)
摘要: 一.numpy库 NumPy系统是Python的一种开源的数值计算扩展。这种工具可用来存储和处理大型矩阵,比Python自身的嵌套列表结构要高效的多(该结构也可以用来表示矩阵(matrix))。 一个用python实现的科学计算,包括: 1、一个强大的N维数组对象Array; 2、比较成熟的(广播) 阅读全文
posted @ 2020-05-06 22:42 ikome 阅读(175) 评论(0) 推荐(0)
摘要: # -*- coding: utf-8 -*- """ Created on Wed May 15 15:43:44 2019 @author: h2446 """ from random import random def printIntro(): print("这个程序模拟两支排球队A和B的排 阅读全文
posted @ 2020-04-22 13:15 ikome 阅读(143) 评论(0) 推荐(0)
摘要: from wordcloud import WordCloud import matplotlib.pyplot as plt import jieba # 生成词云 def create_word_cloud(filename): text = open("{}.txt".format(filen 阅读全文
posted @ 2020-04-08 12:29 ikome 阅读(133) 评论(0) 推荐(0)
摘要: def move(n,a,b,c): if n==1: print(a,'-->',c) else: move(n-1,a,c,b) print(a,'-->',c) move(n-1,b,a,c) move(4,'A','B','C') View Code 阅读全文
posted @ 2020-04-01 12:37 ikome 阅读(121) 评论(0) 推荐(0)
摘要: import math import time scale=20 t=time.process_time() for i in range(scale+1): a,b='**'*i,'..'*(scale-i) c=(i/scale)*100 π=4*(4*math.atan(1/5)-math.a 阅读全文
posted @ 2020-04-01 12:34 ikome 阅读(97) 评论(0) 推荐(0)
摘要: 1.五角星 import turtle turtle.pensize(5) turtle.pencolor("yellow") turtle.left(72) turtle.fillcolor("red") turtle.begin_fill() for _ in range(5): turtle. 阅读全文
posted @ 2020-03-14 21:11 ikome 阅读(117) 评论(0) 推荐(0)
摘要: 1.设置 pensize() 画笔宽度 pencolor() 画笔颜色 fillcolor() 图案填充颜色 2.画笔运动命令 turtle.forward(distance) 向当前画笔方向移动distance像素长 turtle.backward(distance) 向当前画笔相反方向移动dis 阅读全文
posted @ 2020-03-13 12:50 ikome 阅读(434) 评论(0) 推荐(0)
摘要: 1.红色五角星 import turtle turtle.pensize(1) turtle.pencolor("black") turtle.fillcolor("red") turtle.begin_fill() for _ in range(5): turtle.forward(200) tu 阅读全文
posted @ 2020-03-11 23:36 ikome 阅读(78) 评论(0) 推荐(0)