Piping data into Python on the command line - Windows 2000

Duncan Booth duncan at NOSPAMrcp.co.uk
Thu Jun 26 04:28:22 EDT 2003


christianzlong at yahoo.com (Christian Long) wrote in news:8847f370.0306251228.2406f86c at posting.google.com:

> I'm trying to pipe data into a python program on Windows 2000, on the
> command line.
> 
> Like this:
> dir | myProgram.py
> 
> 
This is a well known problem with Windows command line processor.
Try searching Google groups for "Python pipe win2k" and you will 
find several similar threads.

e.g.
http://groups.google.co.uk/groups?threadm=asjset%24n3l%241%40news.vanderbilt.edu

Try running your command with an explicit call to the Python interpreter:

   dir | python myProgram.py

-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?




More information about the Python-list mailing list