01 2016 档案

摘要:原文链接这篇文章介绍了Python中list是如何实现的。在Python中list特别有用。让我们来看下list的内部是如何实现的。来看下面简单的程序,在list中添加一些整数并将他们打印出来。>>> L = []>>> L.append(1)>>> L.append(2)>>> L.append(... 阅读全文
posted @ 2016-01-19 11:04 Vito.K 阅读(7982) 评论(0) 推荐(0)
摘要:The weakref module allows the Python programmer to create weak references to objects.In the following, the term referent means the object which is ref... 阅读全文
posted @ 2016-01-18 16:04 Vito.K 阅读(296) 评论(0) 推荐(0)
摘要:python中基于descriptor的一些概念(上)1. 前言2. 新式类与经典类2.1 内置的object对象2.2 类的方法2.2.1 静态方法2.2.2 类方法2.3 新式类(new-style class)2.3.1 __init__方法2.3.2 __new__静态方法2.4. 新式类的... 阅读全文
posted @ 2016-01-18 14:00 Vito.K 阅读(438) 评论(0) 推荐(0)
摘要:转自:https://blog.shonenada.com/post/websocket-with-flask/WebSocket with FlaskHTML5 以前,HTML 还不支持WebSocket,当时如果要进行实时的内容更新,要么使用Ajax轮询(Polling)或者使用Comet技术。... 阅读全文
posted @ 2016-01-06 11:22 Vito.K 阅读(1313) 评论(0) 推荐(0)
摘要:list 是 Python 中使用最频繁的数据类型, 标准库里面有丰富的函数可以使用。不过,如果把多维列表转换成一维列表(不知道这种需求多不多),还真不容易找到好用的函数,要知道Ruby、Mathematica、Groovy中可是有flatten的啊。如果列表是维度少的、规则的,还算好办例如:li=... 阅读全文
posted @ 2016-01-05 11:36 Vito.K 阅读(4823) 评论(0) 推荐(1)