capturing piped information

Kirill Simonov kirill at xyz.donetsk.ua
Tue Mar 14 05:13:28 CET 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