[Tutor] Communicating Between Programs Using Raw Inputs

Steve Willoughby steve at alchemy.com
Wed Jun 15 01:46:10 CEST 2011


As always, Alan has given a lot of great advice and useful information. 
  There's just one piece at the end I would question, however:


On 14-Jun-11 16:36, Alan Gauld wrote:
 > python reader.py < `python writer.py`

Almost, but not quite.  The backticks mean the command is executed and 
the output substituted back on the command line.  The < bracket means to 
take what follows it as a file NAME (not a data stream).  So unless 
writer.py outputs a filename, you really want something like

python writer.py | python reader.py



-- 
Steve Willoughby / steve at alchemy.com
"A ship in harbor is safe, but that is not what ships are built for."
PGP Fingerprint 4615 3CCE 0F29 AE6C 8FF4 CA01 73FE 997A 765D 696C


More information about the Tutor mailing list