摘要: Python具有基本的文本文件读写功能。Python的标准库提供有更丰富的读写功能。 文本文件的读写主要通过open()所构建的文件对象来实现。 f = open("test.py","r")content = f.read()f.close()print contentfp=open('test.py','w')fp.write("I am a new student.")fp2=op... 阅读全文
posted @ 2014-05-04 22:36 饮露秋林 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-05-03 21:34 饮露秋林 阅读(114) 评论(0) 推荐(0) 编辑
摘要: python 支持格式化字符串的输出。最基本的用法将一个值插入到一个有字符串符%s的字符串中。 阅读全文
posted @ 2014-05-03 20:36 饮露秋林 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 一、Dictionary 的介绍 dictionary 是python 的内置类型之一,它定义键和值之间一对一的关系 1.定义dictionary 2.修改dictionary NOTE: Dictionary 是无序的。当使用 dictionary 时,您需要知道:dictionary 的 key 是大小写敏感的。 3.dictionary 中混用... 阅读全文
posted @ 2014-05-03 20:18 饮露秋林 阅读(286) 评论(0) 推荐(0) 编辑
摘要: def buildConnectionString(params): 阅读全文
posted @ 2014-05-03 18:45 饮露秋林 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 这里是windows 环境下的安装 Windows 环境默认不提供任何版本的python。 这里使用的是安装ActivePython ActiveState 制作的 ActivePython 是专门针对 Windows 的 Python 套件,它包含套件, 一个完整的 Python 发布、一个适用于 发布、一个适用于 Python 编程的 IDE 以及一些 Python 的 Win... 阅读全文
posted @ 2014-05-03 18:38 饮露秋林 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Python应用领域 Web开发、数据库编程、桌面GUI应用开发、科学与数值计算、教育教学、网络应用开发、软件开发(控制、管理、测试等)、游戏与3D影像;游戏开发、网站建设、机器人和航天飞机控制等领域,Python几乎可以用在任何场合。 阅读全文
posted @ 2014-05-03 12:08 饮露秋林 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 内存模型: 为了屏蔽掉各种硬件和操作系统的内存访问差异,以实现让Java程序在各种平台下都能达到一致的并发结果。 阅读全文
posted @ 2014-05-03 11:49 饮露秋林 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 在 @readThroughSingleCache 的实现 中有一个方法: final Method methodToCache = getCacheBase().getMethodToCache(pjp);作用是获取需要缓存的方法。具体如下: public Method getMethodToCache(final JoinPoint jp) throws NoSuchMetho... 阅读全文
posted @ 2014-04-07 16:42 饮露秋林 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 源码中有一个接口:KeyProvider的 方法 String generateKey(final Object keyObject); /** * From the supplied object, create a (no-whitespace) part of the key by which a value will be stored in Memcached. ... 阅读全文
posted @ 2014-04-07 16:33 饮露秋林 阅读(142) 评论(0) 推荐(0) 编辑