#-*- coding:UTF-8 -*-#-*- author:Zahoor Wang
-*-import codecs, os, sys, platform, stringdef env():return platform.system()def
read_file(uri, charset =...
分类:
编程语言 时间:
2014-05-16 04:30:50
阅读次数:
306
libclang是一个提供了C接口的一个库,它让你可以轻松的把clang作为一个库去使用,这样的做法带来了很多的有点,且看本文的一点小论。...
分类:
其他好文 时间:
2014-05-15 20:13:21
阅读次数:
208
最近在做一个网络爬虫程序,后台使用python不定时去抓取数据,前台使用php进行展示
网站是:http://se.dianfenxiang.com...
分类:
编程语言 时间:
2014-05-15 19:49:12
阅读次数:
291
1、文件写入
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import
time
import
random
#打开模式列表:
#w 以写方式打开,
#a 以追加模式打开 (从 EOF 开始, 必要时创建新...
分类:
编程语言 时间:
2014-05-15 19:28:45
阅读次数:
507
在8.04.4环境下(其实我觉得跟环境无关,是我语句有问题):$dpkg-l|grep-ipythoniilibapache2-mod-python3.3.1-2build1Apache2modulethatembedsPythonwithinthiimoinmoin-common1.5.8-5.1ubuntu2.5PythoncloneofWikiWiki-commondataiipython2.5.2-0ubuntu1Aninteractivehigh-l..
分类:
数据库 时间:
2014-05-15 19:17:41
阅读次数:
677
1、第三方库下载:PyPDF2、PythonMagick、Ghostscript。2、PythonMagick的官方下载链接为:http://www.p_w_picpathmagick.org/download/python/,需要自己编译;一个好用的非官方链接为:http://www.lfd.uci.edu/~gohlke/pythonlibs/#pythonmagick。3、如果报下面这种错误,多..
分类:
其他好文 时间:
2014-05-15 19:09:22
阅读次数:
430
1、PIL包推荐Pillow。2、源码:#encoding=utf-8
#author:walker
#date:2014-05-15
#function:更改图片尺寸大小
importos
importos.path
fromPILimportImage
‘‘‘
filein:输入图片
fileout:输出图片
width:输出图片宽度
height:输出图片高度
type:输出图片类型(png,gif,jpeg.....
分类:
编程语言 时间:
2014-05-15 19:07:57
阅读次数:
266
有各种不同的策略来定位页面中的元素。你可以使用最合适定位方式用于你的用例。Selenium提供了以下方法来定位页面中的元素:find_element_by_idfind_element_by_namefind_element_by_xpathfind_element_by_link_textfi.....
分类:
编程语言 时间:
2014-05-15 17:28:48
阅读次数:
430
经过几天的学习,pexpect模块对于linux下运维脚本编写属实有用,下面写个脚本检验下学习效果。#!/usr/bin/envpython
#coding=utf-8
#远程执行服务器上的脚本
importsys,time,os,multiprocessing
try:
importpexpect
exceptImportError:
print"""
Youmustinstallpexpectmodule
"..
分类:
其他好文 时间:
2014-05-15 12:55:28
阅读次数:
260
教材:《简明Python教程》Python面向对象:如shell这种面向过程的程序都是通过“操作数据的函数”或者“语句块”来设计函数。python的程序(面向对象):类是一个“class”类型,对象是类中的一个实例。类的属性包括了:域和方法。(即变量和函数)属于一个对象或类的变量被称为..
分类:
编程语言 时间:
2014-05-15 12:39:21
阅读次数:
351