Created
February 2, 2011 11:23
-
-
Save iorlas/807565 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python -u | |
import os, sys, time, math | |
local = ['alns', 'lns', 's'] | |
#pipe collectors | |
alns = '' | |
lns = [] | |
s = None | |
#pipe catching | |
while True: | |
line = sys.stdin.readline() | |
if line: | |
lns.append(line) | |
alns += line | |
s = line | |
else: | |
break | |
#time.sleep(1) #wait for others | |
#some shortcuts | |
def o(smthng): | |
sys.stdout.write(str(smthng)) | |
sys.stdout.flush() | |
local += ['o'] | |
ret = eval(sys.argv[1]) or '' | |
o(ret) | |
sys.stdout.close() | |
sys.stdin.close() | |
#use it from sh like: | |
# ls | python pype.py "', '.join(map(lambda x: x[:-1], lns))" #gets all files, separated by comma |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment