#!/bin/bash### BEGIN INIT INFO# Provides: xiyoulib# Required-Start: $all# Required-Stop: $all# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Sh...
分类:
系统相关 时间:
2014-07-31 20:40:57
阅读次数:
274
preg_match_all—执行一个全局正则表达式匹配int preg_match_all ( string pattern, string subject, array matches [, int flags] )在 subject 中搜索所有与 pattern 给出的正则表达式匹配的内容并将...
分类:
Web程序 时间:
2014-07-31 20:01:12
阅读次数:
207
什么事都不做的函数就是一个空函数:def kong(): passprint dir(kong())即便是一个空函数,他也会有如下属性:['__call__', '__class__', '__closure__', '__code__', '__defaults__', '__delattr__....
分类:
编程语言 时间:
2014-07-31 19:34:17
阅读次数:
307
昨天配置代码审核工具reviewboard,这个是基于Python的框架Djanjo构建的,需要升级yum源,结果捣鼓来捣鼓去,系统一下子多了3 ,4个python,把Yum也搞坏了。后来不知道看了哪个损比写的帖子,把yum和python卸掉重装...
分类:
编程语言 时间:
2014-07-31 17:28:37
阅读次数:
587
(一)PyCharm ????试用一下,目前VIM只是当做记事本来用,还有好多命令不熟悉,基本就把VIN浪费了。由于之前Java使用Eclipse,这个IDE貌似跟那个差不多,试试吧。官网下载地址:http://www.jetbrains.com/py...
分类:
编程语言 时间:
2014-07-31 17:25:10
阅读次数:
245
import?urllib.request
#jk409??2014-7-31?by?python3.4编写用于[批量]查询IP地址国家区域
def?chaxun(ip_addr):
????ip_addr2=ip_addr
????domain_addr=‘http://ip.taobao.com/service/getIpInfo...
分类:
编程语言 时间:
2014-07-31 17:23:27
阅读次数:
251
正则表达式与python的网页操作练习一:importurllib.request
importre
qname=input(‘inputenglish:‘)
qname=qname.strip()
url=‘http://dict.youdao.com/search?le=eng&q=‘+qname+‘&keyfrom=dict.top‘
html=urllib.request.urlopen(url)
source=html.read().decode(‘U..
分类:
编程语言 时间:
2014-07-31 17:21:47
阅读次数:
242
import os
import sys
import string
#以指定模式打开指定文件,获取文件句柄
def getFileIns(filePath,model):
print("打开文件")
print(filePath)
print(model)
return open(filePath,model)
#获取需要处理的文件
def getProcFi...
分类:
编程语言 时间:
2014-07-31 17:19:07
阅读次数:
291
最近在用python写代码,用到了对象数组。在c++中我们要使用能够灵活操作的对象数组,一般会用stl的vector类,该类的push_back方法可以将一个对象的拷贝加入到vector对象中,所以当使用[]下标对vector的元素进行修改时,原来的作为push_back参数的那个对象的值并不会改变。python中类似的方法是列表的append方法,但是要注意此时若加入到列表中的是基础数据类型,则...
分类:
编程语言 时间:
2014-07-31 16:58:56
阅读次数:
196
UTF-8截取中文字符串 function Cn_Substr($string, $length) { preg_match_all("/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|\xe0[\xa0-\xbf][\x80-\xbf]|[\xe1-\xef...
分类:
Web程序 时间:
2014-07-31 16:37:16
阅读次数:
213