from __future__ import with_statement def logger fn def new args print

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from __future__ import with_statement
def logger(fn):
def new(*args):
print "log: %s%s" % (fn.__name__,str(args))
return fn(*args)
return new
def dummy(fn):
print 'lol'
return fn
@dummy
@logger
def useful(a, b, c):
print(a**2 + b**2)
useful(2,3,123)
#with open('D:\\1.txt') as f:
# print f.read()
class CItem(object):
def __init__(self):
self.query="SELECT * FROM billing.citems c WHERE c.name=%s"
def __del__(self):
self.query=""
print "-> End"