[Python-bugs-list] stdin and arguments (PR#78)

guido@CNRI.Reston.VA.US guido@CNRI.Reston.VA.US
Sun, 12 Sep 1999 18:20:38 -0400 (EDT)


> When using python to pipe some source code like so:
> 
> cat test.py | python - foo bar
> 
> it doesn't give the arguments foo and bar too test.py but thinks
> it is another source file, resulting in a file not found error.

On what platform?  I can't reproduce this.  If my file test.py
contains "import sys; print sys.argv" it correctly prints ['-', 'foo',
'bar'].  This on Solaris.  I'm pretty sure the behavior is the same
across Unix.  On Windows, I indeed get the error you report -- but
your mention of ssh makes me doubt that you are on Windows.

> What I would like to do is pipe it over a ssh connection + a pickled/base64 
> obkject as an argument to do pseudo RPC stuf .

This should work.

(PS if you use the bug report form found via
python.org/search/search_bugs.html instead of mailing directly to
python-bugs-list, you would have been prompted for the platform and
Python version etc.  Please don't mail directly except in response to
a reply like this one.)

--Guido van Rossum (home page: http://www.python.org/~guido/)