搜索到与相关的文章
编程技术

样例UAR报告之一(Label带注释)

ExampleUAR:Aspect1—DateLabelisGood,ItSpeakstheUsers'LanguageOneaspectofthisinterfaceisthatitpresentstheday'sdateinstraightforwardlanguagethatisfamiliartousers.We'llwriteaUARtodocumentthisgoodaspectoftheinterfaceandusethisfirstexam

系统 2019-08-29 21:57:59 2175

Python

Python使用指定端口进行http请求的例子

使用requests库classSourcePortAdapter(HTTPAdapter):""""Transportadapter"thatallowsustosetthesourceport."""def__init__(self,port,*args,**kwargs):self.poolmanager=Noneself._source_port=portsuper().__init__(*args,**kwargs)definit_poolman

系统 2019-09-27 17:56:58 2174

Python

基于ID3决策树算法的实现(Python版)

实例如下:#-*-coding:utf-8-*-fromnumpyimport*importnumpyasnpimportpandasaspdfrommathimportlogimportoperator#计算数据集的香农熵defcalcShannonEnt(dataSet):numEntries=len(dataSet)labelCounts={}#给所有可能分类创建字典forfeatVecindataSet:currentLabel=featVec[-

系统 2019-09-27 17:54:47 2174

Python

Python常用模块介绍

python除了关键字(keywords)和内置的类型和函数(builtins),更多的功能是通过libraries(即modules)来提供的。常用的libraries(modules)如下:1)python运行时服务*copy:copy模块提供了对复合(compound)对象(list,tuple,dict,customclass)进行浅拷贝和深拷贝的功能。*pickle:pickle模块被用来序列化python的对象到bytes流,从而适合存储到文件

系统 2019-09-27 17:54:16 2174

Python

Python文件IO

使用open函数,第一个参数为文件名,例如“C:\abc.txt”,这里要注意的是r“C:\abc.txt”。第二个参数为文件的操作方式,这里着重探讨写入,写入主要分为覆盖写入和追加写入。#覆盖写入例子:file=open(r'C:\abc.txt','w')file.write("abc")#写入字符串file.close#关闭文件#追加写入例子:file=open(r'C:\abc.txt','a')file.write("abc")#写入字符串fil

系统 2019-09-27 17:53:29 2174

Python

利用Python如何生成hash值示例详解

一、介绍如果在Python中需要对用户输入的密码或者其他内容进行加密,首选的方法是生成hash值。在Python中可以利用二个模块来进行:-crypt-hashlib二、crypt(一)crypt的主要方法和常量名称描述md5(…)利用md5算法加密sha1(…)利用sha1算法加密sha224(…)利用sha224算法加密sha256(…)利用sha256算法加密sha384(…)利用sha384算法加密sha512(…)利用sha512算法加密(二)使

系统 2019-09-27 17:52:57 2174

Python

Python函数系列之嵌套及闭包(二)

函数的嵌套在Python编程语言中,在函数体内创建另外一个函数(对象,因为Python一切皆对象,函数其实也是对象)是完全合法的,这种函数叫做内部/嵌套函数。例子:#coding:utf-8defouter():definner():print("isInnerMethod")print("IsouterMethod")inner()#调用outer函数outer()#调用outer()的内部函数,报错#inner()运行结果:IsouterMethodi

系统 2019-09-27 17:52:56 2174

Python

来自python自学者的小问题

我想使用python的第三方库,但是我的IDE给我一个错误代码:D:\untitled\venv\Scripts\python.exe"D:/pycode/venv/sxsxsxsxs.py"Traceback(mostrecentcalllast):File"D:\untitled\venv\lib\site-packages\urllib3\connectionpool.py",line597,inurlopenself._prepare_proxy(

系统 2019-09-27 17:52:39 2174

Python

Python 命令行之旅:使用 argparse 实现 git 命令

Python命令行之旅:使用argparse实现git命令作者:HelloGitHub-ProdesireHelloGitHub的《讲解开源项目》系列,项目地址:https://github.com/HelloGitHub-Team/Article前言在前面三篇介绍argparse的文章中,我们全面了解了argparse的能力,相信不少小伙伴们都已经摩拳擦掌,想要打造一个属于自己的命令行工具。本文将以我们日常工作中最常见的git命令为例,讲解如何使用arg

系统 2019-09-27 17:52:36 2174

Python

Python 冒泡,选择,插入排序使用实例

最近学习了python基础,写一下3大排序练练手:复制代码代码如下:'''Createdon2013-8-23@author:codegeek'''//冒泡排序defbubble_sort(seq):foriinrange(len(seq)):forjinrange(i,len(seq)):ifseq[j]

系统 2019-09-27 17:52:28 2174