예제 #1
0
def unpack_ttl(r, pos):
    return reduce(lambda x, y: (x << 8) | y, map(ord, r[pos:pos + 4]))
예제 #2
0
 def sum(self, *values):
     return reduce(lambda a, b: a + b, values, 0)
예제 #3
0
 def product(self, *values):
     return reduce(lambda a, b: a * b, values, 1)
예제 #4
0
def unpack_ttl (r,pos):
    return reduce (
            lambda x,y: (x<<8)|y,
            map (ord, r[pos:pos+4])
            )
예제 #5
0
 def sum (self, *values):
     return reduce (lambda a,b: a+b, values, 0)
예제 #6
0
 def product (self, *values):
     return reduce (lambda a,b: a*b, values, 1)