-
修改无穷层次最里层的值
所属栏目:[Python] 日期:2020-12-17 热度:59
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 def getList(data):if isinstance(data,dict): for i in data:path.append(i)getList(data[i]) def set_value(path,dd,value): def get_path(path): i[详细]
-
python2.7自动创建虚拟机
所属栏目:[Python] 日期:2020-12-17 热度:66
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # -*- coding: cp936 -*-#jk409 于2014-8-27用python2.7编写的批量复制文件和修改虚拟机配置文件的脚本import os,os.path,shutilimport re,timeclass[详细]
-
删除windows 垃圾文件
所属栏目:[Python] 日期:2020-12-17 热度:115
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #coding:utf-8import os#from glob import globif os.name == 'nt':if 'HOMEPATH' in os.environ:home = os.environ['HOMEDRIVE'] + os.environ['HOME[详细]
-
AQQ批量网站工具集之目标网站脚本类型判断
所属栏目:[Python] 日期:2020-12-17 热度:152
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。 如果觉得编程之家网站内容还不错,欢迎将编程之家[详细]
-
分享一个好东东 本地电脑获取 internet ip
所属栏目:[Python] 日期:2020-12-17 热度:126
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 分享一个好东东 本地电脑获取 internet ip .python 中第一步 安装ipgetterpip install ipgetter import ipgetter myip = ipgetter.myip() myip 以上是[详细]
-
批量下载豆瓣妹子的图片
所属栏目:[Python] 日期:2020-12-17 热度:193
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/env pythonimport urllib.requestfrom bs4 import BeautifulSoupdef crawl(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Win[详细]
-
AQQ批量网站工具集之目标网站标题(Title)抓取
所属栏目:[Python] 日期:2020-12-17 热度:96
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。 如果觉得编程之家网站内容还不错,欢迎将编程之家[详细]
-
#python正则求txt文件中所有Z后面数字的最小值和最大值3
所属栏目:[Python] 日期:2020-12-17 热度:165
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #python正则求txt文件中所有Z后面数字的最小值和最大值3#依山居 10:57 2015/11/11#题目来源: http://www.bathome.net/thread-38027-1-1.html#这个版本[详细]
-
获取代理ip
所属栏目:[Python] 日期:2020-12-17 热度:124
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #coding:utf-8from bs4 import BeautifulSoupimport requestsimport randomdef getproxyip():headers = {'Accept':'text/html,application/xhtml+xml,[详细]
-
情人节的颤抖
所属栏目:[Python] 日期:2020-12-17 热度:100
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #! /usr/bin/env python# -*- encoding: utf-8 -*-# author dpc import wximport random class cry(wx.App): def OnInit(self): mm = wx.DisplaySize([详细]
-
python实现将文本转换成语音的方法
所属栏目:[Python] 日期:2020-12-17 热度:168
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # Text To Speech using SAPI (Windows) and Python module pyTTS by Peter Parente# download installer file pyTTS-3.0.win32-py2.4.exe # from: ht[详细]
-
python提取知乎当前最热的问答内容
所属栏目:[Python] 日期:2020-12-17 热度:113
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 无详细内容 #-*- coding: utf-8 -*-import urllib.requestimport refrom _io import opendef yunpan_search(): url = "https://www.zhihu.com/explore[详细]
-
模拟登录封包python实现
所属栏目:[Python] 日期:2020-12-17 热度:107
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/env python# encoding:utf-8 from socket import *from ctypes import create_string_bufferfrom struct import *import sysconfigimport[详细]
-
Python 中使用 MongoDB 存储爬虫数据
所属栏目:[Python] 日期:2020-12-17 热度:182
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/python# -*- coding:utf-8 -*-import pymongoclass documentManager(object): def __init__(self): pass def connect_mongo(self): client[详细]
-
Python代码运行助手
所属栏目:[Python] 日期:2020-12-17 热度:112
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/env python3# -*- coding: utf-8 -*- r'''learning.py A Python 3 tutorial from http://www.liaoxuefeng.com Usage: python3 learning.py[详细]
-
Python爬虫-抓取手机APP数据
所属栏目:[Python] 日期:2020-12-17 热度:183
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 抓取超级课程表话题数据。 博文:http://my.oschina.net/jhao104/blog/606922 #!/usr/local/bin/python2.7# -*- coding: utf8 -*-""" 超级课程表话题[详细]
-
python根据股票代码获取当前数据
所属栏目:[Python] 日期:2020-12-17 热度:53
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 上班时间通过浏览器打开股票网站怕会被别人看到,没关系,试试在命令行下执行代码看数据就行了。 输入sh,就可以查看到上证指数 输入sz,就可以查看深[详细]
-
Djano发送邮件
所属栏目:[Python] 日期:2020-12-17 热度:86
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 入门例子 from django.core.mail import send_mailsend_mail(u'邮件标题',u'邮件内容','[email?protected]',['[email?protected]'],fail_silently=Fal[详细]
-
django 非常实用的无限级分类功能
所属栏目:[Python] 日期:2020-12-17 热度:148
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 1 2 3 4 5 6 7 ? ?? def ?htmlpath ( self ) : ? ? ? ? paths? = ? [ ] ? ? ? ?? for ?p? in ? self . path . split ( ':' ) : ? ? ? ? ? ? c? = ?Art[详细]
-
django 文件上传
所属栏目:[Python] 日期:2020-12-17 热度:122
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 有如下一个form: from django import forms class UploadFileForm(forms.Form): ??title = forms.CharField(max_length=50) ??file = forms.FileField[详细]
-
python包含中文字符串长度
所属栏目:[Python] 日期:2020-12-17 热度:79
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 def str_len(str): try: row_l=len(str) utf8_l=len(str.encode('utf-8')) return (utf8_l-row_l)/2+row_l except: return None return None 以上是编[详细]
-
python 爬虫
所属栏目:[Python] 日期:2020-12-17 热度:135
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/python#coding=utf-8import?urllibimport?redef?getHtml(url):????page?=?urllib.urlopen(url)????html?=?page.read()????return?htmldef?[详细]
-
Python获取脚本所在目录的正确方法
所属栏目:[Python] 日期:2020-12-17 热度:118
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 C:test??[dir]?getpath????[file]?path.py????[dir]??sub??????[file]?sub_path.py 以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能[详细]
-
Python获取Linux系统内存情况
所属栏目:[Python] 日期:2020-12-17 热度:188
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 [Python]代码???? import subprocessimport rekeydic = {"MemTotal":"总内存(单位G)","MemFree":"剩余内存(单位G)","MemAvailable":"可用内存(单位G)"[详细]
-
python shell 根据 ip 获取 hostname
所属栏目:[Python] 日期:2020-12-17 热度:153
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 python shell 根据 ip 获取 hostname 或根据 hostname 获取 ip 前言 方法1:利用 socket 模块 里的 gethostbyname 函数 import socket socket.gethost[详细]
