3 ms·
is raw_input the same as stdin? I don't think you can pipe other programs into it.
by dec0dedab0de 13y ago
is raw_input the same as stdin? I don't think you can pipe other programs into it.
- eurleif 13y ago>is raw_input the same as stdin? Yes. $ echo foo | python -c 'print raw_input()[::-1]' oof
- dec0dedab0de 13y agoUpvoted. I guess I was thinking more along the lines of one shouldn't use raw_input() when you're expecting a pipe since it only takes one line. $ ps | python -c 'print raw_input()' PID TTY TIME CMD But I suppose you could just loop to get around that anyway.