importgc gc.disable() http://blog.csdn.net/aixiaohei/article/details/6446869
分类:
编程语言 时间:
2014-07-21 00:14:12
阅读次数:
219
SQLAlchemy ORM的学习笔记ORM(Object Relational Mapper)为我们完成的工作:自动构造高水平的SQL; Python对象的持久化。1. Object Relational Tutorial (对象关系)SQLAlchemy ORM提供了一种方法,这种方法将用户定义...
分类:
数据库 时间:
2014-07-21 00:07:31
阅读次数:
461
简单的二叉树的先根遍历模板的应用
class Solution:
# @param root, a tree node
# @return an integer
def hehe(self, num, root):
#再原来的基础上*10,再加上当前的root.val
num = num * 10 + root.val
...
分类:
其他好文 时间:
2014-07-20 22:45:33
阅读次数:
299
2014年7月20日
北京,晴,33℃
北京的夏天是燥热的,我攒了5万块钱,今天,我开始创业。
先自我介绍一下吧,1990年出生,去年大学本科毕业。来北京工作一年半,精通安卓,对产品有感觉,熟悉IOS,熟悉Python+Django,本科时有过创业经历。
我的家在河北唐山,中国北方。在我们那有一句谚语,“东北虎,唐山狼,XXX的小绵羊”。我认为我自小有一种“狼性”,说白了就...
分类:
其他好文 时间:
2014-07-20 22:45:03
阅读次数:
260
python中无论参数传递还是函数返回值,都是进行引用传递。那如何拷贝对象呢,标准库的copy模块提供了两个方法:copy和deepcopy方法。
1. copy.copy 浅拷贝 只拷贝父对象,不会拷贝对象的内部的子对象。
2. copy.deepcopy 深拷贝 拷贝对象及其子对象
见下例:
import copy
a = [1, 2, 3, 4, ['a', 'b']] #原始...
分类:
编程语言 时间:
2014-07-20 22:41:53
阅读次数:
308
windows下的python开发环境搭建的一个简单教程,包括python安装,ez_install pip virtualenv的安装使用以及一些注意事项
分类:
编程语言 时间:
2014-07-20 22:29:47
阅读次数:
425
一、基本形式
列表有自己的sort方法,其对列表进行原址排序,既然是原址排序,那显然元组不可能拥有这种方法,因为元组是不可修改的。
x = [4, 6, 2, 1, 7, 9]
x.sort()
print x
# [1, 2, 4, 6, 7, 9]
如果需要一个排序好的副本,同时保持原有列表不变,怎么实现呢
x = [4, 6, 2, 1, 7, 9]
y = x[ : ...
分类:
编程语言 时间:
2014-07-20 22:16:03
阅读次数:
252
《Kivy A to Z -- 如何从python代码中直接访问Android的Service》 一文中讲到了如何从python访问java的service,这一篇再来讲下如何创建一个基于Binder的Python Service以及如何从Java代码中访问这个Python创建的Service。...
分类:
编程语言 时间:
2014-07-20 22:12:03
阅读次数:
312
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
click to show spoilers.
Have you thought about this?
Here are some good questions to ask before c...
分类:
编程语言 时间:
2014-07-20 22:12:03
阅读次数:
251
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
比较两个...
分类:
编程语言 时间:
2014-07-20 22:12:03
阅读次数:
273