码迷,mamicode.com
首页 >  
搜索关键字:python list    ( 182949个结果
简单修改文件名python脚本
import osimport syspath = "D:\emojis"for (path,dirs,files) in os.walk(path): for filename in files: newname = "emoji_"+filename os.re...
分类:编程语言   时间:2014-06-05 20:42:02    阅读次数:391
OGNL表达式
1 2 OGNL是从ActionContext中获取数据的。 3 4 ActionContext的结构: 5 ValueStack: 6 List:动作类放在此处。取存放在ValueStack中的root的对象的属性,直接写即可 ...
分类:其他好文   时间:2014-06-05 19:26:57    阅读次数:471
python基础
操作符:// 用作浮点除法(对结果四舍五入)和 ** 表示乘方 eg: 2**5=32python不支持C中的自增和自减操作,eg: ++i 和 i++ 的结果都为 iraw_input()方法程序输入,所返回的值为 字符串 类型,数值须进行强制类型转换 eg:int()print()会默认为每一行...
分类:编程语言   时间:2014-06-05 18:37:25    阅读次数:299
python版protobuf 安装
1. 下载protobuf源代码(当前最新版本为:2.5.0) #cd /opt #wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz 2. 解压,编译,安装 #tar zx...
分类:编程语言   时间:2014-06-05 17:44:39    阅读次数:4474
python--日期操作
import datetimedatetime有几个常用类:date time datetime timedelta1. 今天日期时间(今天时间)>>> import datetime>>> now = datetime.datetime.now()>>> print now2014-06...
分类:编程语言   时间:2014-06-05 16:47:38    阅读次数:299
Python核心编程(第二版) 第六章习题答案
6–1.字符串.string 模块中是否有一种字符串方法或者函数可以帮我鉴定一下一个字符串是否是另一个大字符串的一部分?答:有,string.find(str,beg,end)6–2.字符串标识符.修改例 6-1 的 idcheck.py 脚本,使之可以检测长度为一的标识符,并且可以识别 Pytho...
分类:编程语言   时间:2014-06-05 15:25:41    阅读次数:338
学习资源(二)
最近在微博中发现MOOC上有了Python的教程,出于兴趣就打算简单的听一听了解一下,今天听了第一期的讲座,老师讲的非常形象,大家有兴趣可以去看一看https://class.coursera.org/pythonlearn-002/lecture课程是全英文的,但是有英文字幕,在学习的同时可以学习...
分类:其他好文   时间:2014-06-05 14:35:33    阅读次数:266
leetcode--Rotate List
Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL./** *...
分类:其他好文   时间:2014-06-05 13:44:26    阅读次数:250
leetcode--Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor...
分类:其他好文   时间:2014-06-05 13:41:44    阅读次数:231
Python,ElementTree模块处理XML时注释无法读取和保存的问题
from xml.etree import ElementTreeclass CommentedTreeBuilder ( ElementTree.XMLTreeBuilder ): def __init__ ( self, html = 0, target = None ): ...
分类:编程语言   时间:2014-06-05 13:16:31    阅读次数:261
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!