搜索到与相关的文章
Python

安装anaconda出现This Python interpreter

安装anaconda后在命令行中出现ThisPythoninterpreterisinacondaenvironment,buttheenvironmenthasnotbeenactivated.Librariesmayfailtoload.Toactivatethisenvironmentpleaseseehttps://conda.io/activation解决方式使用终端或Anaconda提示符执行以下步骤。默认情况下,活动环境---您当前使用的环境

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

Python

Python内存管理机制 之 内存池机制

参考链接:https://blog.csdn.net/weixin_35324294/article/details/93038210https://www.cnblogs.com/geaozhang/p/7111961.html#neicunchijizhi内存池机制内存池(memorypool)的概念:当创建大量消耗小内存的对象时,频繁调用new/malloc会导致大量的内存碎片,致使效率降低。内存池的概念就是预先在内存中申请一定数量的,大小相等的内存

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

Python

Gauss-Seidel迭代算法的Python实现详解

importnumpyasnpimporttime1.1Gauss-Seidel迭代算法defGaussSeidel_tensor_V2(A,b,Delta,m,n,M):start=time.perf_counter()find=0X=np.ones(n)d=np.ones(n)m1=m-1m2=2-mforiinrange(M):print('X',X)x=np.copy(X)#迭代更新forjinrange(n):a=np.copy(A)forkin

系统 2019-09-27 17:53:12 2342

Python

python爬虫---从零开始(二)Urllib库

接上文再继续我们的爬虫,这次我们来述说Urllib库1,什么是Urllib库Urllib库是python内置的HTTP请求库urllib.request请求模块urllib.error异常处理模块urllib.parseurl解析模块urllib.robotparserobots.txt解析模块不需要额外安装,python自带的库。注意:python2importurllib2response=urllib2.urlopen('http://baidu.c

系统 2019-09-27 17:50:06 2342

Python

python-序列解包(对可迭代元素的快速取值方法)

一般情况下x,y,z=1,2,3print("x:",x)print("y:",y)print("z:",z)#运行结果x:1y:2z:3对元祖序列解包name=("qiaobushi","wanglihong","leibushi")x,y,z=nameprint(name)print("x:",x)print("y:",y)print("z:",z)#运行结果('qiaobushi','wanglihong','leibushi')x:qiaobush

系统 2019-09-27 17:48:57 2342

Python

python3 enum模块

原文链接:https://www.cnblogs.com/bdhk/p/7506691.html枚举是绑定到唯一的常量值的一组符号名称(成员)。在枚举中,成员可以通过身份进行比较,枚举本身可以迭代。1.Enum模块该模块定义了四个枚举类,可用于定义唯一的名称和值集:Enum,IntEnum,Flag和IntFlag。它还定义了一个装饰器,unique()和一个helper,auto。ContentDescriptionRemarksclassenum.En

系统 2019-09-27 17:48:52 2342

Python

python中的%s%d%s

转发:https://blog.csdn.net/qq_37482544/article/details/63720726

系统 2019-09-27 17:48:11 2342

Python

Linux下原码安装 python-3.6.6

Linux下原码安装python-3.6.6下载#wgethttps://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz安装依赖包#yum-yinstallzlib-develbzip2-developenssl-develsqlite-develreadline-develgcc解压并进入到解压目录#tarxvfPython-3.6.6.tgz#cdPython-3.6.6/修改Modules/Setup

系统 2019-09-27 17:47:22 2342

Python

Python微信操控(itchat)

itchat是一个开源的微信个人号接口,使用python调用微信从未如此简单。开源地址https://github.com/littlecodersh/ItChat文档:https://itchat.readthedocs.io/zh/latest/安装:pip3installitchat登入与登出登入并向文件助手发送一句话,登入时会经过扫码操作,类似于电脑微信登入1importitchat2#登入并保存登入状态,实现第一次运行时扫码,一定时间内再次运行就

系统 2019-09-27 17:47:08 2342

Python

Python检测字符串中是否包含某字符集合中的字符

目的检测字符串中是否包含某字符集合中的字符方法最简洁的方法如下,清晰,通用,快速,适用于任何序列和容器复制代码代码如下:defcontainAny(seq,aset):forcinseq:ifcinaset:returnTruereturnFalse第二种适用itertools模块来可以提高一点性能,本质上与前者是同种方法(不过此方法违背了Python的核心观点:简洁,清晰)itertools.ifilter(predicate,iterable)的说明M

系统 2019-09-27 17:46:52 2342