首页 软件开发 代码片段 python ( Page 64 )

python 1073

#Python
python实现ftp上传文件

mport ftplib, sys ftp1 = ftplib.FTP('127.0.0.1', 'book', 'bookpw') ftp1.cwd('/Dir') ftp2 =…

2015-03-27 721

#Python
爬取动态网页数据

#coding:utf-8 import urllib2 import re from bs4 import BeautifulSoup class fanli(): def __…

2015-03-25 813

#Python
下载小说到本地

 import re import os import urllib.request # 小说目录 home = "http://www.23zw.com/olread/9/90…

2015-03-25 704

#Python
python字典C段IP筛选整理.py

""" python字典C段IP筛选整理.py 题目来源 http://www.bathome.net/thread-38037-1-2.html 依山居 7:16 2015/11…

2015-03-25 915

#Python
python不下载获取远程图片的宽度和高度及文件大小的方法

python中处理图片可以使用PIL库,PIL全称Python Imaging Library,就是python图形处理库的意思。在PIL中,可 以使用Imag…

2015-03-25 474

#Python
python中map的用法

map用来对一个列表里的元素分别调用同一函数进行处理,然后返回一个新的列表 #范例1: >>> print map(abs, [-5,7,-12] ) [5, 7…

2015-03-25 838

#Python
Python在windows下模拟按键和鼠标点击代码

这段代码可以模拟在窗口上按下按键、鼠标左键点击、鼠标右键点击、鼠标双击等等 # # _*_ coding:UTF-8 _*_ import win32api import win3…

2015-03-25 989

#Python
Python压缩和解压缩文件(zip/unzip)

通过zipfile模块实现对文件、文件夹的zip压缩和解压 #打包成zip文件 import zipfile f = zipfile.ZipFile('archive.zip','…

2015-03-24 454

#Python
python通过urllib2提交http post请求

python通过urllib2提交http post请求 #!/usr/bin/python #coding=utf-8 import urllib import urllib2 …

2015-03-24 799

#Python
python转换字符串为datetime类型

python中通过日期转换函数把字符串格式的日期转换成datetime格式的日期格式 time.strptime() converts the string to a struct…

2015-03-24 782

#Python
python登陆网页并处理网站session和cookie

这是一个python通过urllib直接登陆网站,并处理网站的session和cookie import cookielib, urllib, urllib2 login = 'i…

2015-03-24 161

#Python
python多线程不断刷新网页的代码

这段代码可以开通过个线程不断刷新指定的页面,可用于刷票,增加网页访问量等等,不用再去按F5了 import thread import urllib2 import sys imp…

2015-03-24 196
1 62 63 64 65 66 90