
Untitled
By: a guest on
Aug 20th, 2012 | syntax:
Python | size: 0.33 KB | hits: 19 | expires: Never
non_null = lambda x: (i for i in x if x isnt None)
# Loop time!
with till_loop_stop():
with catch(KeyboardInterrupt):
for item in non_null(get_items(from_socket)):
counts['received'] += 1
for modified in modify(item):
send_to(to_socket, modified)
counts['sent'] += 1