-
python操作redis
所属栏目:[Python] 日期:2020-12-17 热度:167
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/python#coding=utf-8import redisclass CRedis: def __init__(self): self.host = 'localhost' self.port = 6379 self.db = 0 self.r = re[详细]
-
一行代码求1~100的阶乘
所属栏目:[Python] 日期:2020-12-17 热度:56
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 print reduce(lambda x,y: x*y,xrange(1,101)) 以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。 如[详细]
-
从驼峰命名的串中提取单词子串形成数组
所属栏目:[Python] 日期:2020-12-17 热度:130
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #coding=utf8result = []def run2(name): for i in range(1,len(name)): if name[i].isupper(): a = run2(name[i:]) s = name[:i] a.append(s) return[详细]
-
python处理csv数据(不具备参考功能)
所属栏目:[Python] 日期:2020-12-17 热度:74
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #coding=utf-8__author__ = 'dehua.li'from datetime import *import datetimeimport csvimport sysimport timeimport stringimport osimport os.path[详细]
-
下载png图标素材II
所属栏目:[Python] 日期:2020-12-17 热度:180
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 ?import osimport reimport urllib.requestkey = ["code","help","about","close"] #需要下载的图标素材关键字min = 16 #min sizemax = 16 #max sizeh[详细]
-
爬取豆瓣照片
所属栏目:[Python] 日期:2020-12-17 热度:118
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/env python# -*- coding: utf-8 -*-# @Date : 2014-12-22 14:46:40# @Author : Your Name ([email?protected])# @Link : http://example.o[详细]
-
随机生成激活码并保存到Mysql数据库
所属栏目:[Python] 日期:2020-12-17 热度:73
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/env python# -*- coding: utf-8 -*-# @Author: mllyn# @Date: 2014-12-31 15:26:59# @Last Modified by: mllyn# @Last Modified time: 201[详细]
-
利用新闻情感数据炒股 python程序
所属栏目:[Python] 日期:2020-12-17 热度:128
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 from CAL.PyCAL import Datestart = '2010-01-01' # 回测起始时间end = '2015-05-05' # 回测结束时间benchmark = 'HS300' # 策略参考标准universe = s[详细]
-
生成手机号码
所属栏目:[Python] 日期:2020-12-17 热度:172
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # _*_ coding:utf-8 _*_#xiaohei.python.SEO.call.me:)#win+python2.7.xnumber = "1350571"with open("hm.txt","w") as f:for i in range(0001,9999):[详细]
-
使用Python开发实用计算器
所属栏目:[Python] 日期:2020-12-17 热度:181
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/env python# -*- coding: utf-8 -*-'''Author : Mr.LiuYCCreated on 2014-09-30E-Mail : [email?protected]Introduction: 简易计算器 实现[详细]
-
计算一个图形中的三角形数目
所属栏目:[Python] 日期:2020-12-17 热度:129
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/python"""---------------------------------------------------------------------------------------------------2015.07.23 Grey******[详细]
-
在局域网中发布共享文件
所属栏目:[Python] 日期:2020-12-17 热度:102
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/env python#coding:utf8# Author : tuxpy# Email : [email?protected]# Last modified : 2014-10-03 19:22:22# Filename : client.py# Des[详细]
-
抓取淘宝下拉框关键词
所属栏目:[Python] 日期:2020-12-17 热度:86
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 import urllib2,refor key in open('key.txt'): do = "http://suggest.taobao.com/sug?code=utf-8q=%s" % key.rstrip() _re = re.findall('["(.*?)[详细]
-
同步重庆时时彩的数据到本地数据库
所属栏目:[Python] 日期:2020-12-17 热度:114
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/env python#-*-coding:utf-8-*-""" 从 cp.360.cn 同步时时彩的数据到表 haoma"""import datetimefrom datetime import timedeltaimport ti[详细]
-
python模拟鼠标拖动操作
所属栏目:[Python] 日期:2020-12-17 热度:151
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 ## _*_ coding:UTF-8 _*___author__ = 'wp'import win32apiimport win32conimport win32guifrom ctypes import *import timeSW = 1377SH = 768VK_CODE[详细]
-
连续子数组的最大和
所属栏目:[Python] 日期:2020-12-17 热度:118
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 class Solution: def FindGreatestSumOfSubArray(self,array): if not array: return 0 rest = [] for i in range(len(array)): sum = array[i] rest.[详细]
-
输入一个整数,输出该数二进制表示中1的个数。其中负数用补码表
所属栏目:[Python] 日期:2020-12-17 热度:54
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # -*- coding:utf-8 -*-class Solution: def NumberOf1(self,n): if n=0: nbin = bin(n) count = nbin.count('1') return count else: num = abs(n) n[详细]
-
使用python进行简单的文本处理
所属栏目:[Python] 日期:2020-12-17 热度:165
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 涉及到如下方面 txt文本的读取,utf8的处理 字符串的基本操作 dict的基本操作 list(数组)的基本操作 #!/usr/bin/python#print "Hello World"str_sepera[详细]
-
Windows下python监控脚本
所属栏目:[Python] 日期:2020-12-17 热度:159
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/env python# encoding: utf-8"""MonitorLog.pyUsage: MonitorLog.py ...Monitor the log file-f log file-h help infopython MonitorLog.p[详细]
-
MySQLdb 使用方法
所属栏目:[Python] 日期:2020-12-17 热度:82
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # -*- coding: utf-8 -*- #mysqldb import time,MySQLdb #连接 conn=MySQLdb.connect(host="localhost",user="root",passwd="",db="test",charset="ut[详细]
-
多线程抓网站图片
所属栏目:[Python] 日期:2020-12-17 热度:152
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 if __name__ == '__main__':for page in range(sPage,ePage+1):# 下载的page范围print ''*40+(' Page %d ' % page)+''*40urlPage = urlRoot+'/p01/lis[详细]
-
python分析列表文件的内容是否支持JSON
所属栏目:[Python] 日期:2020-12-17 热度:97
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/python # -*- coding:utf8 -*-#该脚本是检查客户端同事给的TXT文件是否支持JSON格式#只有通过后,才能交给运维同事处理抓取视频import osi[详细]
-
smtplib模块发送邮件
所属栏目:[Python] 日期:2020-12-17 热度:64
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # 导入 smtplib 和 MIMETextimport smtplibfrom email.mime.text import MIMEText# 定义发送列表mailto_list=["[email?protected]","[email?protected[详细]
-
Python发邮件带附件
所属栏目:[Python] 日期:2020-12-17 热度:134
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 import osimport sysfrom smtplib import SMTPfrom email.MIMEMultipart import MIMEMultipartfrom email.mime.application import MIMEApplicationim[详细]
-
Python测试Sqlite代码
所属栏目:[Python] 日期:2020-12-17 热度:114
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 from sqlite3 import *import os,time,datetime,platformpath = "./testP.sqlite"log = open("./testP.log","a+")con = connect(path)def prepare():[详细]
