coding

软件工程实践2019第三次作业

只愿长相守 提交于 2019-11-30 11:25:57
GitHub地址: https://github.com/WYH2/031702206 PSP表格 PSP Personal Software Process Stages 预估耗时(分钟) 实际耗时(分钟) Planning 计划 Estimate 估计这个任务需要多少时间 Development 开发 Analysis 需求分析 (包括学习新技术) Design Spec 生成设计文档 Design Review 设计复审 Coding Standard 代码规范 (为目前的开发制定合适的规范) Design 具体设计 Coding 具体编码 Code Review 代码复审 Test 测试(自我测试,修改代码,提交修改) Reporting 报告 Test Repor 测试报告 Size Measurement 计算工作量 Postmortem & Process Improvement Plan 事后总结, 并提出过程改进计划 合计 来源: https://www.cnblogs.com/wuyahong/p/11581928.html

python中星号变量的特殊用法

微笑、不失礼 提交于 2019-11-30 09:04:00
引言 在Python中,星号除了用于乘法数值运算和幂运算外,还有一种特殊的用法"在变量前添加单个星号或两个星号",实现多参数的传入或变量的拆解,本文将详细介绍"星号参数"的用法。 1. 什么是星号变量 最初,星号变量是用在函数的参数传递上的,在下面的实例中, 单个星号 代表这个位置接收任意多个非关键字参数,在函数的 b位置上将其转化成元组, 双星号代表这个位置接收任意多个关键字参数,在**b位置上将其转化成字典: #!/usr/bin/env python #coding=utf-8 #-------- def one ( a , * b ) : """a是一个普通传入参数,*b是一个非关键字星号参数""" print ( b ) one ( 1 , 2 , 3 , 4 , 5 , 6 ) #-------- def two ( a = 1 , ** b ) : """a是一个普通关键字参数,**b是一个关键字双星号参数""" print ( b ) two ( a = 1 , b = 2 , c = 3 , d = 4 , e = 5 , f = 6 ) #程序输出 ( 2 , 3 , 4 , 5 , 6 ) { 'b' : 2 , 'c' : 3 , 'e' : 5 , 'f' : 6 , 'd' : 4 } #从输出中可以看到,第一个函数中,

第一次结对编程作业

拜拜、爱过 提交于 2019-11-30 08:33:54
原型模型设计工具 Axure RP 8.0 设计说明 PSP PSP2.1 Personal Software Process Stages 预估耗时(分钟) 实际耗时(分钟) Planning 计划 30 · Estimate · 估计这个任务需要多少时间 30 Development 开发 480 · Analysis · 需求分析 (包括学习新技术) 150 · Design Spec · 生成设计文档 10 · Design Review · 设计复审 10 · Coding Standard · 代码规范 (为目前的开发制定合适的规范) 10 · Design · 具体设计 30 · Coding · 具体编码 200 · Code Review · 代码复审 10 · Test · 测试(自我测试,修改代码,提交修改) 60 Reporting 报告 75 · Test Repor · 测试报告 30 · Size Measurement · 计算工作量 15 · Postmortem & Process Improvement Plan · 事后总结, 并提出过程改进计划 30 · 合计 1800 原型设计 1.注册登录 2.历史战绩及排行榜 3.游戏界面 来源: https://www.cnblogs.com/artkary/p/11575685.html

Python处理csv、xlsx、pdf

丶灬走出姿态 提交于 2019-11-30 06:53:04
一、csv文件的处理 CSV(Comma-Separated Values)即逗号分隔值,可以用Excel打开查看。由于是纯文本,任何编辑器也都可打开。与 Excel 文件不同,CSV 文件中: 值没有类型,所有值都是字符串 不能指定字体颜色等样式 不能指定单元格的宽高,不能合并单元格 没有多个工作表 不能嵌入图像图表 1.1 csv读取数据 在CSV文件中,以 "," 作为分隔符,分隔两个单元格。像这样 a,,c 表示单元格 a 和单元格 c 之间有个空白的单元格。依此类推。 不是每个逗号都表示单元格之间的分界。所以即使CSV是纯文本文件,也坚持使用专门的模块进行处理。Python内置了csv模块。先看看一个简单的例子。 #!/usr/bin/env python # -*- coding:utf-8 -*- # @Time : 2018/6/7 20:43 # @Author : zhouyuyao # @File : demon1.py import csv filename = "E:/GitHub/Python-Learning/LIVE_PYTHON/2018-06-05/学位英语成绩合格汇总表.csv" with open(filename) as f: reader = csv.reader(f) print(list(reader)) reader 不能直接打印

day08字符编码问题

荒凉一梦 提交于 2019-11-30 06:22:09
day 08整理 字符编码 python 解释器启动应用程序的三个流程 1.把字符读入python解释器(python解释器相当于文本编辑器)--->字符编码 2.识别字符 3.往终端打印结果----->字符编码 第一步解决方法:python2默认使用ascill码读入字符;python3默认使用utf8 可以使用coding:gbk 修改为 gbk读入字符 第二步解决方法:python2中存储变量用Unicode/coding指定的编码存储变量 python3默认使用unicode存储变量 假设python2用coding指定的gbk存储变量,终端支持的编码是utf8 乱码 假设python2用unicode(u'中文')存储变量,终端支持的编码是utf8 假设python3 用unicode存储变量,终端支持的编码是Utf8/gbk 来源: https://www.cnblogs.com/kaizi111/p/11567483.html

Scrapy框架的基本组成及功能使用

本秂侑毒 提交于 2019-11-30 06:17:20
1.什么是scrapy? Scrapy是一个为了爬取网站数据,提取结构性数据而编写的应用框架。框架的本质就是集成各种功能、具有很强通用性的项目模板。 2.安装    Linux: pip3 install scrapy   Windows:===》见Twisted安装 a. pip3 install wheel b. 下载twisted http: / / www.lfd.uci.edu / ~gohlke / pythonlibs / #twisted c. 进入下载目录,执行 pip3 install Twisted‑ 17.1 . 0 ‑cp35‑cp35m‑win_amd64.whl d. pip3 install pywin32 e. pip3 install scrapy 3.基础使用===》相关命令都是在命令行执行   3.1.创建项目:scrapy startproject 项目名称   3.2.创建爬虫应用程序:       cd project_name(进入项目目录)       scrapy genspider 应用名称 爬取网页的起始url (例如:scrapy genspider qiubai www.qiushibaike.com)       在步骤2执行完毕后,会在项目的spiders中生成一个应用名的py爬虫文件   3.3

while实现图形打印的练习

断了今生、忘了曾经 提交于 2019-11-30 03:56:42
while打印矩形 实现代码 # *_*coding:utf-8 *_* # author:yuhuashang x = 1 y = 1 while y <= 10: while x <= 10: print("*", end="") x += 1 x = 1 y+= 1 print("\n") while打印九九乘法表 实现代码 # *_*coding:utf-8 *_* # author:yuhuashang x = 1 while x <= 9: y = 1 while y <= x: print("%d*%d=%d\t"%(y, x, x*y), end="") y += 1 x += 1 print("\n") 打印倒等边三角形 实现代码 # *_*coding:utf-8 *_* # author:yuhuashang num = int(input("请输入行号:")) a = 0 while a < num: b = 0 while b < a: print(" ", end="") b += 1 c = num - a while c > 0: print("* ", end="") c -= 1 print("\n") a += 1 来源: https://my.oschina.net/u/3193075/blog/3108516

[Daily Coding Problem 293] Minimum Cost to Construct Pyramid with Stones

醉酒当歌 提交于 2019-11-30 03:44:00
You have N stones in a row, and would like to create from them a pyramid. This pyramid should be constructed such that the height of each stone increases by one until reaching the tallest stone, after which the heights decrease by one. In addition, the start and end stones of the pyramid should each be one stone high. You can change the height of any stone by paying a cost of 1 unit to lower its height by 1 , as many times as necessary. Given this information, determine the lowest cost method to produce this pyramid. For example, given the stones [1, 1, 3, 3, 2, 1] , the optimal solution is to

[Daily Coding Problem 294] Shortest round route with rising then falling elevations

笑着哭i 提交于 2019-11-30 02:50:09
A competitive runner would like to create a route that starts and ends at his house, with the condition that the route goes entirely uphill at first, and then entirely downhill. Given a dictionary of places of the form {location: elevation} , and a dictionary mapping paths between some of these locations to their corresponding distances, find the length of the shortest route satisfying the condition above. Assume the runner's home is location 0 . For example, suppose you are given the following input: elevations = {0: 5, 1: 25, 2: 15, 3: 20, 4: 10} paths = { (0, 1): 10, (0, 2): 8, (0, 3): 15,

初识Python

ⅰ亾dé卋堺 提交于 2019-11-30 02:35:33
Python简介 Python前世今生 python的创始人为吉多·范罗苏姆(Guido van Rossum)。1989年的圣诞节期间,吉多·范罗苏姆为了在阿姆斯特丹打发时间,决心开发一个新的脚本解释程序,作为ABC语言的一种继承。 最新的TIOBE排行榜,Python赶超PHP占据第五!!! 由上图可见,Python整体呈上升趋势,反映出Python应用越来越广泛并且也逐渐得到业内的认可!!! Python可以应用于众多领域,如:数据分析、组件集成、网络服务、图像处理、数值计算和科学计算等众多领域。目前业内几乎所有大中型互联网企业都在使用Python,如:Youtube、Dropbox、BT、Quora(中国知乎)、豆瓣、知乎、Google、Yahoo!、Facebook、NASA、百度、腾讯、汽车之家、美团等。互联网公司广泛使用Python来做的事一般有:自动化运维、自动化测试、大数据分析、爬虫、Web 等。 注视:上述重点字体表示该公司主要使用Python语言开发 为什么是Python而不是其他语言? C 和 Python、Java、C#等 C语言: 代码编译得到 机器码 ,机器码在处理器上直接执行,每一条指令控制CPU工作 其他语言: 代码编译得到 字节码 ,虚拟机执行字节码并转换成机器码再后在处理器上执行 Python 和 C Python这门语言是由C开发而来