搜索到与相关的文章
Python

Centos 6.4 安装Python 2.7 python-pip的详细步骤

1.准备工作下载源码包wgethttp://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2查看是否安装make工具~#rpm-qa|grepmakeautomake-1.11.1-4.el6.noarchmake-3.81-20.el6.x86_64如果没有安装make工具yum-yinstallgccautomakeautoconflibtoolmake查看是否安装zlib库~#rpm-qa|grepzl

系统 2019-09-27 17:56:34 2245

Python

python的pstuil模块使用方法总结

代码importpsutilprint(dir(psutil))#查看逻辑cpu的个数print(psutil.cpu_count())#查看物理cpu的个数print(psutil.cpu_count(logical=False))#查看cpu的用户时间,系统时间,空闲时间,中断时间print(psutil.cpu_times())#统计每个cpu的使用率print(psutil.cpu_percent(interval=2,percpu=True))#

系统 2019-09-27 17:56:18 2245

Python

python自动化测试之setUp与tearDown实例

本文实例讲述了python自动化测试之setUp与tearDown的用法,分享给大家供大家参考。具体如下:实例代码如下:classRomanNumeralConverter(object):def__init__(self):self.digit_map={"M":1000,"D":500,"C":100,"L":50,"X":10,"V":5,"I":1}defconvert_to_decimal(self,roman_numeral):val=0for

系统 2019-09-27 17:56:11 2245

Python

python中bs4.BeautifulSoup的基本用法

导入模块frombs4importBeautifulSoupsoup=BeautifulSoup(html_doc,"html.parser")下面看下常见的用法print(soup.a)#拿到soup中的第一个a标签print(soup.a.name)#获取a标签的名称print(soup.a.string)#获取a标签的文本内容print(soup.a.text)#获取a标签的文本内容print(soup.a["href"])#获取a标签的href属性

系统 2019-09-27 17:55:49 2245

Python

Python3多线程版TCP端口扫描器

本文实例讲述了python数据结构之Array用法,分享给大家供大家参考。具体方法如下:importctypesclassArray:def__init__(self,size):assertsize>0,"Arraysizemustbe>0"self._size=sizepyArrayType=ctypes.py_object*sizeself._elements=pyArrayType()self.clear(None)defclear(self,va

系统 2019-09-27 17:55:37 2245

Python

合并多个excel Excel+Python

合并多个excel1.https://jingyan.baidu.com/article/e6c8503cb6ed7ee54e1a1811.html2.python#-*-coding:utf-8-*-importxlrd,xlsxwriter#待合并excelallxls=["C:\\Users\\wangjun\\Desktop\\ALL\\lvjie(6)(1).xlsx","C:\\Users\\wangjun\\Desktop\\ALL\\lvj

系统 2019-09-27 17:55:23 2245

Python

python json操作

jsonJSON(JavaScriptObjectNotation)是一种轻量级的数据交换格式,易于人阅读和编写。json是我们在制作爬虫时非常常见的网络对象,本文就列举python对于json的基本操作。json函数使用json函数首先要导入json库即importjson主要使用以下两个函数:json.dumps将Python对象编码成JSON字符串json.loads将已编码的JSON字符串解码为Python对象json.dumpsjson.dump

系统 2019-09-27 17:54:25 2245

Python

切换Python2版本到Python3版本

实测系统:ubuntu16.4debain9.01.Ubuntu16.04系统自带Python2.7和Python3.5,而默认采用的是2.7版本,可采用如下命令查看单当前版本号:python-V2.Python2.7和3.5都是默认安装在/usr/local/lib/python2.7(3.5)目录下,link文件在/usr/bin文件夹下,需要删除默认pythonlink文件pythonsudorm/usr/bin/python重新建立链接,并指向Py

系统 2019-09-27 17:53:40 2245

Python

(Adversarial Examples)的原理与python实现

最近基于对抗样本做了一些工作,这里写一篇论文介绍对抗样本基本的原理和生成方法。内容上参考Goodfellow的论文ExplainingandHarnessingAdversarialExamples一、什么是对抗样本?对抗样本的概念最早提出于2014年Szegedy的论文IntriguingPropertiesofNeuralNetworks.在论文,作者发现了一种有趣的现象,即:当前流行的机器学习模型包括神经网络会容易以很高的置信度分错和原始样本仅仅有轻

系统 2019-09-27 17:53:26 2245