实现文件的读写#! /usr/bin/pythonfile_add = open('test.txt','a')for i in range(1,5): file_add.write("1.1.1.%d 255.255.255.255 %d 2.2.2.%d 255.255.255.1...
分类:
编程语言 时间:
2014-09-15 12:40:08
阅读次数:
245
此脚本适用于备份指定发布目录下的目录,可适当修改运用!#!/usr/bin/envpython#backupapppythonscript.importosimporttimeimportsysnowTime=time.strftime("%Y%m%d")sourcePath=‘/home/zcb/resin-4.0.10/apps/‘backupPath=‘/home/zcb/tmp/bak‘+nowTimeifnotos.path.exists(‘/h..
分类:
编程语言 时间:
2014-09-15 11:29:19
阅读次数:
266
第03章: 使用字符串
------
支持的操作
索引
切片
增加元素
删除元素
更新元素
查找元素(检查某个元素是否是序列中的一员)
序列长度
最大值
最小值
其他内建函数...
分类:
编程语言 时间:
2014-09-15 06:38:48
阅读次数:
236
原题地址:http://oj.leetcode.com/problems/swap-nodes-in-pairs/Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2...
分类:
编程语言 时间:
2014-09-15 06:38:18
阅读次数:
200
以前所用的操作系统是centos,如今用的操作系统是debian,所以开始适应,转变。debian安装之后发现默认没有安装ssh,所以先安装ssh服务并启动apt-getinstallssh
/etc/init.d/sshstart接下来安装pexpect,paramiko模块。若要安装上面的模块,先安装setuptools模块。安装setuptoo..
分类:
编程语言 时间:
2014-09-15 03:28:08
阅读次数:
192
原题地址:https://oj.leetcode.com/problems/reverse-linked-list-ii/题意:Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Gi...
分类:
编程语言 时间:
2014-09-14 23:38:47
阅读次数:
239
原题地址:https://oj.leetcode.com/problems/add-two-numbers/题意:You are given two linked lists representing two non-negative numbers. The digits are stored i...
分类:
编程语言 时间:
2014-09-14 23:17:17
阅读次数:
292
第02章: 列表和数组
------
在Python中最基本的数据结构是序列,每个元素分配一个序号,即元素的序号,也即索引。注意,需要从0开始,第一位0,第二位为1,依次类推. Python包括: 字符串,列表,元祖,字典 这四种常用数据结构,或者说四种序列,其中元祖为不可变序列.
列表和元祖的主要区别...
分类:
编程语言 时间:
2014-09-14 22:12:02
阅读次数:
357