-
ping网段设备
所属栏目:[Python] 日期:2020-12-17 热度:58
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/env python#coding:utf-8import os,time,random,threadpool,sysfrom progressbar import *COUNT=0tit=1000PINGIP=[]def main():ipd=Noneif[详细]
-
o(n)时间复杂度替换字符串中空格为%20
所属栏目:[Python] 日期:2020-12-17 热度:156
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 class offer_book:def replaceBlank( p_str,rpl_str ):blank = ' 'numOfBlank = 0originalLen = len( p_str )for char in p_str:if char == blank:num[详细]
-
python读取管道判断C盘是不是SSD
所属栏目:[Python] 日期:2020-12-17 热度:187
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #python读取管道判断C盘是不是SSD#依赖开源工具smartmontool中的ssmartctl.exe#http://sourceforge.net/projects/smartmontools/#方法1import ostxt=o[详细]
-
格式化字符串
所属栏目:[Python] 日期:2020-12-17 热度:127
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 a,b=5,42 print(a,b)5 42 'this is {},and that is {}'.format(a,b)'this is 5,and that is 42' s = 'this is {},and that is {}' s'this is {},and t[详细]
-
遍历制定目录下所有文件
所属栏目:[Python] 日期:2020-12-17 热度:167
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #_*_coding:utf-8_*_import osimport globdef findall(folder):'''遍历指定后缀文件'''if os.path.exists(folder):folder2 = glob.iglob(folder+'*.mp[详细]
-
一个简洁的Python清理脚本
所属栏目:[Python] 日期:2020-12-17 热度:177
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #coding:utf-8'''Created on Aug 31,2015@author: mac'''import os,time,sysdef remove(path): """ Remove the file or directory """ if os.path.isd[详细]
-
FeelUOwn 更新 2015-8-27
所属栏目:[Python] 日期:2020-12-17 热度:52
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。 如果觉得编程之家网站内容还不错,欢迎将编程之家[详细]
-
每隔一段时间访问百度
所属栏目:[Python] 日期:2020-12-17 热度:105
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #coding: utf-8import sysimport urllibimport urllib2from BeautifulSoup import BeautifulSoupfrom time import sleepwhile(True): try: res = urll[详细]
-
AQQ批量网站工具集之调用浏览器打开URL列表
所属栏目:[Python] 日期:2020-12-17 热度:91
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 ?#! /usr/bin/env python#coding=utf-8# AQQ批量网站工具集之调用浏览器打开URL列表# http://www.oschina.net/code/list_by_user?id=2008177# http://[详细]
-
简单插入排序
所属栏目:[Python] 日期:2020-12-17 热度:129
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #-*- encoding= utf-8 -*-def insertsort(list): if list != None: if len(list) == 1: pass else: for i in range(1,len(list)):#start with second[详细]
-
python正则取一列数中连续最长的奇数个数.py
所属栏目:[Python] 日期:2020-12-17 热度:115
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 """python正则取一列数中连续最长的奇数个数.py题目来源http://www.oschina.net/code/snippet_2519674_52255大费周折地使用正则表达式来干这事~~只能[详细]
-
一个简单的数学问题:200囚徒
所属栏目:[Python] 日期:2020-12-17 热度:110
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 n=1a=range(1,201)x=len(a)while x1:for i in a:if i%2**n!=0:a.remove(i)n+=1x=len(a)print a 以上是编程之家(jb51.cc)为你收集整理的全部代码内容,[详细]
-
抓取糗事百科文字笑话
所属栏目:[Python] 日期:2020-12-17 热度:116
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # -*- coding:utf-8 -*-#制作者:archingBimport urllibimport urllib2import rereadme="按下回车键开始读取,q退出,w写入save.txt"def getpage(page[详细]
-
对当前目录下的所有APK包执行Monkey测试,并自动保存Crash日志
所属栏目:[Python] 日期:2020-12-17 热度:107
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/env python#coding=utf-8import osimport timeimport randomimport reapks = [x for x in os.listdir('.') if os.path.isfile(x) and os.p[详细]
-
Python发送邮件的例子,运维人员使用
所属栏目:[Python] 日期:2020-12-17 热度:115
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # -*- coding: UTF-8 -*-'''发送txt文本邮件'''import smtplibfrom email.mime.text import MIMETextimport os,sysif len(sys.argv) 5 or len(sys.arg[详细]
-
采用二分查找找出某个数字的下标
所属栏目:[Python] 日期:2020-12-17 热度:168
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 class Solution(object): def searchRange(self,nums,target): """ :type nums: List[int] :type target: int :rtype: List[int] """ def binary_sear[详细]
-
检查系统模块的代码是否可用
所属栏目:[Python] 日期:2020-12-17 热度:181
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 python -m test.regrtest -j3 以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。 如果觉得编程之家网[详细]
-
开源软件批量下载
所属栏目:[Python] 日期:2020-12-17 热度:133
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 import requestsimport lxmlimport geventfrom lxml import htmlimport osfrom gevent import monkey; monkey.patch_os()monkey.patch_socket()from m[详细]
-
删除空文件和空文件夹
所属栏目:[Python] 日期:2020-12-17 热度:156
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #-*- coding:cp936 -*-"""os.walk()函数声明:walk(top,topdown=True,onerror=None)1参数top表示需要遍历的目录树的路径2参数topdown的默认值是"True"[详细]
-
python实现爬虫下载美女图片
所属栏目:[Python] 日期:2020-12-17 热度:103
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #-*- coding:utf-8 -*- http://www.aichengxu.comimport urllib2import reimport requestsfrom lxml import etree这些是要导入的库,代码并没有使用正[详细]
-
发送邮件,可带附件,可群发
所属栏目:[Python] 日期:2020-12-17 热度:135
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # 这是发布本信息时的版本,请以github上的为主要参考def send_email(login=None,mail=None,images=None,attachments=None,use_ssl=None): smtpserver[详细]
-
python继承练习
所属栏目:[Python] 日期:2020-12-17 热度:119
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 class Employee(object): """Models real-life employees!""" def __init__(self,employee_name): self.employee_name = employee_name def calculate[详细]
-
python 多态实例
所属栏目:[Python] 日期:2020-12-17 热度:139
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # coding:utf-8"""多态(英语:Polymorphism),是指面向对象程序运行时,相同的消息可能会送给多个不同的类之对象,而系统可依据对象所属类,引发对[详细]
-
python编写小程序(计算器)
所属栏目:[Python] 日期:2020-12-17 热度:96
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #coding=gbkdef yunsuan(userA,userB,operate): '运算函数' try: A = int(userA) B = int(userB) operate_list = { '+':(A+B),'-':(A-B),'*':(A * B),[详细]
-
uwsgi
所属栏目:[Python] 日期:2020-12-17 热度:55
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 uwsgi socket127.0.0.1:9000/socket master/ chdir/imp/frontend/chdir pythonpath../pythonpath processes8/processes moduledjango_uwsgi/module da[详细]
