parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Combining --pipe and --shebang options


From: Michel Samia
Subject: Combining --pipe and --shebang options
Date: Fri, 16 Nov 2012 14:13:12 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121028 Thunderbird/16.0.2

Hello and thanks for the great piece of code,

is it possible to combine --shebang and --pipe options? I have a python script reading lines from stdin, processing them somehow and printing the processed lines on stdout. I would like to change #!/usr/bin/python to something like #!/usr/bin/parallel --shebang --pipe -k -j24 /usr/bin/python to ease the execution of the script, but it didn't work (atleast in version 20120322).

I think it is not important but if it helps, the script (after the change) looks like this:

#!/usr/bin/parallel --shebang --pipe -k -j24 /usr/bin/python

import sys

if len(sys.argv) > 1:
    MIN_FREQ = float(sys.argv[1])
else:
    MIN_FREQ = 10

infile = sys.stdin
outfile = sys.stdout

for line in infile:
    cols = line.split('\t')
    if float(cols[1])>= MIN_FREQ:
        outfile.write(line)


with greetings from Czech rep.,
Michel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]