Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
# -*- coding: utf-8 -*- | |
import os, sys, locale | |
import site, os | |
locale.setlocale(locale.LC_TIME,'ru_RU.utf8') | |
#projects_root = '/home/codeboy/xxx/svn2/' | |
# | |
#if projects_root not in sys.path: |
// КОНТРОЛЛЕР | |
Ext.define('C300.controller.Base', { | |
extend: 'Ext.app.Controller', | |
stores:[ | |
'C300.store.streetStore' | |
], | |
views: [ |
### | |
# Sending sms via smsaero.ru gate | |
### | |
import requests | |
import time | |
import hashlib | |
def sms_sender( | |
number='79825552211', |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
def get_context(self, request): | |
context = self.context | |
query = ''' | |
SELECT pp.*, cc.*, au.*, row_to_json(rf.*) as recv_fund, row_to_json(ci.*) as invoice FROM payments_payment pp | |
LEFT JOIN customers_customer cc ON cc.id=pp.customer_id | |
LEFT JOIN auth_user au ON au.id=cc.user_id | |
LEFT JOIN payments_receivedfund rf ON pp.op_type=0 AND rf.id=pp.target | |
LEFT JOIN customers_customerinvoice ci ON pp.op_type=2 AND ci.id=pp.target | |
''' | |
q_payments, q_rows = db_aliases_query_dict(query, 'hosting') |
# Copyright (c) 2010, Philip Plante of EndlessPaths.com | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in |
import tornado.ioloop | |
import tornado.web | |
import tornado.gen | |
import tornado.httpclient | |
class GenAsyncHandler(tornado.web.RequestHandler): | |
@tornado.web.asynchronous | |
@tornado.gen.engine | |
def get(self): |
Skype - codeboy.ru
Опыт более 10 лет работы в разработке интернет проектов. Принял участие в создании и развитии десятках различных проектов. От сложных, до очень сложных. Умею работать как в большой команде, так и один. Могу разрабатывать проекты, как с нулевой стадии, так и переделывать уже действующие. Способен спасти даже самый пропащий проект.
''' | |
You should try libtorrent (rasterbar). http://libtorrent.org | |
If you want to write your client in python, on linux, install it with: | |
sudo apt-get install python-libtorrent | |
A very simple example of python code to use it to download a torrent: | |
''' | |
import libtorrent as lt |