capturing piped information

Kirill Simonov kirill at xyz.donetsk.ua
Mon Mar 13 23:13:28 EST 2000


On Mon, Mar 13, 2000 at 06:14:07PM +0000, Oleg Broytmann wrote:
> > how do I access this piped information inside the script?
> 
> import sys
> while 1:
>    line = sys.stdin.readline()
>    if not line: break
>    Process(line)

Or

import sys
for line in sys.stdin.readlines():
	Process(line)

--
Kirill Simonov




More information about the Python-list mailing list