Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
#!/usr/bin/env python | |
# | |
# Vkontatke OAuth 2.0 wrapper | |
# Copyright 2011, Adil Khashtamov [[email protected]] | |
# http://khashtamov.kz | |
# | |
# | |
import logging |
DO WTF YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Alexey Silin <[email protected]> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WTF YOU WANT TO PUBLIC LICENSE |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<meta content='text/html, charset=UTF-8' http-equiv='Content-Type' /> | |
<meta content='IE=7,IE=8,IE=9' http-equiv='X-UA-Compatible' /> | |
<meta content='initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport' /> | |
<style type="text/css"> | |
@import url("http://code.leafletjs.com/leaflet-0.3.1/leaflet.css"); | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, |
import os | |
''' | |
The command "deluge-console info" generates this output: | |
/home/pi$ deluge-console info | |
Name: Some video file | |
ID: 670b10e3842dfe57bedbd0653b09f0548034cbbb |
import asyncio | |
import tornado.concurrent | |
import tornado.ioloop | |
import tornado.web | |
import tornado.platform.asyncio | |
import tornado.httpclient | |
class ReqHandler(tornado.web.RequestHandler): | |
async def get(self): |
import asyncio | |
@asyncio.coroutine | |
def open_file(name): | |
print("opening {}".format(name)) | |
return open(name) | |
@asyncio.coroutine | |
def close_file(file): | |
print("closing {}".format(file.name)) |
Skype - codeboy.ru
Опыт более 10 лет работы в разработке интернет проектов. Принял участие в создании и развитии десятках различных проектов. От сложных, до очень сложных. Умею работать как в большой команде, так и один. Могу разрабатывать проекты, как с нулевой стадии, так и переделывать уже действующие. Способен спасти даже самый пропащий проект.