here document as script and read from stdin

Donn Cave donn at u.washington.edu
Tue Apr 20 18:50:58 EDT 2004


In article <408596DE.10004 at jessikat.fsnet.co.uk>,
 Robin Becker <robin at SPAMREMOVEjessikat.fsnet.co.uk> wrote:

> Is it possible to use python with a shell HERE document as the script 
> and read the standard input? In other words make python usable as a 
> filter with a side input?
> 
> It doesn't seem to be obvous unless I can somehow use the -c option.

Use "-" as the name of the file - e.g.,

 python - << 'EOT'
 import sys
 print sys.argv
 EOT

   Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list