码迷,mamicode.com
首页 >  
搜索关键字:coding    ( 12955个结果
python标准库之sched 定时事件调度器
#-*-coding:utf-8-*-#作者:新手__author__='Administrator'#py标准库之schedimporttimeimportsched#定时事件调度器#使用time来掌握当前时间,还有一个是延迟(delay)来指定一个时间段#调用time是不带任何参数的,返回当前一...
分类:编程语言   时间:2015-03-02 14:43:55    阅读次数:150
python面向对象编程实例解析
1. 类和函数面向对象编程的例子:#!/usr/bin/env python# -*- coding: utf-8 -*-class Person(object): #在属性和变量的前面增加“__”就可以将该变量或者方法转换成私有变量,要访问私有变量可以添加方法访问 def __init...
分类:编程语言   时间:2015-03-02 14:31:24    阅读次数:170
python删除指定日期前的备份文件
这个脚本还有待完善,没有加入迭代子目录,后期完善。#!/bin/envpython #coding=utf-8 importtime,datetime,os,sys dir=‘/usr/local/src‘ #被删除文件写入日志文件 logdir=‘/var/log‘ logfile=os.path.join(logdir,‘delete.log‘) #定义时间格式 time_format="%a%b%d%H:%M:%S..
分类:编程语言   时间:2015-03-02 11:29:13    阅读次数:146
Python爬画途旅发现相册
利用python3提供的urllib.request很方便爬网页上的东西。 1、urllib.request.urlopen(url)打开网页,并读取read() 2、python正则分析图片链接,如 3、urllib.request.urlretrieve(url, filename)下载相应的url图片,保存到filename 详细看代码: # coding = utf-8 #...
分类:编程语言   时间:2015-03-02 01:05:13    阅读次数:245
git 学习合集
http://git-scm.com/book/zh/v1/简明教程http://rogerdudler.github.io/git-guide/index.zh.html解决同一分支远程和本地冲突http://www.01happy.com/git-resolve-conflicts/coding.nethttps://coding.net/u/coding/p/Coding-Feedback/git/blob/master/git-starter-tutorial.md
分类:其他好文   时间:2015-03-01 22:28:29    阅读次数:166
用python做爬虫的例子
主要就是用了两个库,urllib和BeautifulSoup.作用是从HTML中解析出解梦的查询词和具体的解释。 1 # -*- coding: utf-8 -*- 2 import urllib, urllib2 3 import time, random 4 from BeautifulSoup...
分类:编程语言   时间:2015-03-01 14:23:32    阅读次数:189
亲身试用python简单小爬虫
前几天基友分享了一个贴吧网页,有很多漂亮的图片,想到前段时间学习的python简单爬虫,刚好可以实践一下。 以下是网上很容易搜到的一种方法: 1 #coding=utf-8 2 import urllib 3 import re 4 5 def getHtml(url): 6 pag...
分类:编程语言   时间:2015-03-01 14:21:50    阅读次数:164
Python发送邮件
#-*- coding:gb2312 -*-import smtplibfrom email.mime.text import MIMETextfrom email.mime.multipart import MIMEMultipartdef sendmail(to, sub, content): ...
分类:编程语言   时间:2015-02-28 18:20:05    阅读次数:192
python 发送电子邮件模块smtplib
#!/usr/bin/python #-*-coding:utf-8-*- importsmtplib importstring HOST="smtp.uinx.com.cn" SUBJECT="TestemailfromPython" #TO="yafeng.jin@archermind.com" #TO="desheng.shi@archermind.com" TO="yunxing.le@archermind.com" FROM="smurf@uinx.com.cn" text="Pyhonrules..
分类:编程语言   时间:2015-02-28 16:43:58    阅读次数:197
IP地址爬取
ip_spider.py= = =#!/usr/bin/python# coding: utf-8import osimport sysimport requestsimport reimport urllibimport sysreload(sys)sys.setdefaultencoding( ...
分类:其他好文   时间:2015-02-28 15:57:27    阅读次数:104
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!