3 ms·
Also, does Windows support redirection? If this were a one-off task that I were to do on my Linux box, I'd have written only: import sys template = ..
by Deejahll 16y ago
Also, does Windows support redirection? If this were a one-off task that I were to do on my Linux box, I'd have written only:
import sys
template = ... # (same as above)
for line in sys.stdin:
print template % {
... # (same as above)
}
Then execute like this:
python mycode.py < original.txt > output.txt