-
从订阅源下载图片的例子
所属栏目:[Python] 日期:2020-12-17 热度:130
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 __author__ = 'Saint'import osimport urllib.requestimport jsonfrom html.parser import HTMLParser# 从获取的网页内容筛选图片的内容class MyHtmlP[详细]
-
Python批量将word转html,并将html内容发布至网站。
所属栏目:[Python] 日期:2020-12-17 热度:156
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #coding=utf-8__author__ = 'zhm'from win32com import client as wcimport osimport timeimport randomimport MySQLdbimport redef wordsToHtml(dir)[详细]
-
python处理ArcGIS多图层矢量裁剪
所属栏目:[Python] 日期:2020-12-17 热度:108
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # -*- coding: utf-8 -*-#导入包import arcpyimport osimport datetimestartTime=datetime.datetime.now()print "Python Tool Start--------^_^------[详细]
-
像素翻转
所属栏目:[Python] 日期:2020-12-17 热度:93
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #coding=utf-8class Transform: def transformImage(self,mat,n): res = [] for i in range(n): rest =[] for j in range(n-1,-1,-1): rest.append(ma[详细]
-
Python 字符串操作(string替换、删除、截取、复制、连接、比较
所属栏目:[Python] 日期:2020-12-17 热度:191
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 去空格及特殊符号 s.strip().lstrip().rstrip(',') 复制字符串 #strcpy(sStr1,sStr2)sStr1?=?'strcpy'sStr2?=?sStr1sStr1?=?'strcpy2'print?sStr2 连[详细]
-
common iter query
所属栏目:[Python] 日期:2020-12-17 热度:184
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 def iquery(conn,sql,rowfactory=tuple,batch=1,*args,**kwgs): """在给定的数据库连接conn上执行sql(可带有参数*args或命名参数**kwgs) rowfactory指[详细]
-
查询python模块的帮助文档
所属栏目:[Python] 日期:2020-12-17 热度:161
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #_*_coding:utf-8_*_import sysdef get_doc(module):'''返回导入模块的帮助文档'''mod = __import__(module)print mod.__doc__if __name__ == '__main[详细]
-
加权摇号(加权轮盘赌)算法
所属栏目:[Python] 日期:2020-12-17 热度:84
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # coding: utf-8import randomdef chose(num_chose,weight,id): ## 输入摇号名额,参与摇号人员的ID和权重 if len(weight) != len(id): return u"摇号[详细]
-
练习
所属栏目:[Python] 日期:2020-12-17 热度:107
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #输出第一个参数中的且在其他参数中都出现过的字符,出现几次输出几次#!/usr/bin/pythondef intersect(*args):print 'args[0]:',str(args[0])print 'a[详细]
-
下载锤子OS重绘的图标
所属栏目:[Python] 日期:2020-12-17 热度:163
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # -*- coding: utf-8 -*-from gevent import monkeymonkey.patch_all()from gevent.pool import Poolimport urllib2import reimport osall_pic_urls =[详细]
-
使用libvirt抓取linux kvm虚拟机的缩略图
所属栏目:[Python] 日期:2020-12-17 热度:97
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 import libvirtimport osimport uuidtry: from PIL import Image print("PIL")except ImportError: import Imagedef handler(stream,buf,opaque): fd[详细]
-
续"如何捅破python编程的那层纸之三"
所属栏目:[Python] 日期:2020-12-17 热度:132
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # coding:utf-8import itertoolsdef sameSums1(int_list): if len(int_list) == 1: # 列表只有一个元素必不能等分两组 return False sum_of_lsit = su[详细]
-
python写的用WMI检测windows系统信息、硬盘信息、网卡信息
所属栏目:[Python] 日期:2020-12-17 热度:96
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 python写的用WMI检测windows系统信息、硬盘信息、网卡信息 #!/usr/bin/env python# -*- coding: utf-8 -*-import wmiimport sys,time,platform def ge[详细]
-
获取慕课网视频教程
所属栏目:[Python] 日期:2020-12-17 热度:105
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # -*- coding: utf-8 -*-from scrapy.spider import Spiderfrom scrapy.http.request import Requestfrom scrapy.selector import Selectorfrom scrap[详细]
-
快速排序python实现。
所属栏目:[Python] 日期:2020-12-17 热度:94
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 def quickSort(arg): if(arg==[]): return [] return quickSort([i for i in arg[1:] if i=arg[0]])+[arg[0]]+quickSort([i for i in arg[1:] if iarg[详细]
-
mxrange 模拟 系统 xrange
所属栏目:[Python] 日期:2020-12-17 热度:144
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 def mxrange(start,end=0,step=1): (start,end) = startend and (end,start) or (start,end) while start end: yield start start+=step print [i for[详细]
-
中文竖排
所属栏目:[Python] 日期:2020-12-17 热度:162
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 import mathx=u'衣食者人之生利也,然且犹尚有节,葬埋者人之死利也,夫何独无节於此乎。'def shupai(text,width): seq = [ c for c in text if c.str[详细]
-
python helloworld
所属栏目:[Python] 日期:2020-12-17 热度:126
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/env python# -*- coding: utf-8 -*-' a test module '__author__ = 'test'import sysdef test(): args = sys.argv if len(args)==1: print[详细]
-
python实现数据结构中的栈
所属栏目:[Python] 日期:2020-12-17 热度:112
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #coding:utf-8#author:Elvisclass Stack(object): def __init__(self,size=8): self.stack = [] self.size = size self.top = -1 def is_empty(self):[详细]
-
判断输入的是否为回文
所属栏目:[Python] 日期:2020-12-17 热度:77
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 def isPalindrome(s):def toChars(s):s = s.lower()ans = ''for c in s:if c in 'abcdefghijklmnopqrstuvwxyz':ans = ans + creturn ansdef isPal(s):[详细]
-
找出所有链接的python脚本
所属栏目:[Python] 日期:2020-12-17 热度:80
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 import requestsimport re# get urlurl = input('Enter a URL (include `http://`): ')# connect to the urlwebsite = requests.get(url)# read htmlh[详细]
-
这个Python类用于获取代码执行时间
所属栏目:[Python] 日期:2020-12-17 热度:84
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 """ExecutionTimeThis class is used for timing execution of code.For example: timer = ExecutionTime() print 'Hello world!' print 'Finished in[详细]
-
计算蛋白质分子量大小(MW)、等电点(pI)和消光系数
所属栏目:[Python] 日期:2020-12-17 热度:144
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # -*- coding: UTF-8 -*-AA="ACDEFGHIKLMNPQRSTVWY"AA_residue={'A': 71.0788,'C': 103.1388,'D': 115.0886,'E': 129.1155,'F': 147.1766,'G': 57.051[详细]
-
思科路由器交换机自动化安全配置核查脚本
所属栏目:[Python] 日期:2020-12-17 热度:133
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #coding: utf-8#!/usr/bin/python'''1,用于Cisco设备的配置核查,原理上是在show running-config结果中对关键配置命令进行搜索,H3C设备后续再做吧。[详细]
-
FTP Server & Client
所属栏目:[Python] 日期:2020-12-17 热度:145
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。 如果觉得编程之家网站内容还不错,欢迎将编程之家[详细]
