does os.popen() search the path?
Mark Hammond
MarkH at ActiveState.com
Sat Oct 14 10:10:11 EDT 2000
More information about the Python-list mailing list
Sat Oct 14 10:10:11 EDT 2000
- Previous message (by thread): asyncore: where is handle_timeout() ?
- Next message (by thread): does os.popen() search the path?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
<jschmitt at vmlabs.com> wrote in message news:8s8ubv$21q$1 at nnrp1.deja.com... > I can get it to print the PATH environment variable and it tells me > that things like 'grep' are in my path. Yet, > > cmd = os.popen( 'grep' ) > > never launches. Never launches, or launches and quickly terminates? "grep" with no options will attempt to read from stdin, but no stdin it setup, so it will exit immediately. eg: >>> len(os.popen("grep --help").read()) 2112 > Another thing, I can also do this: > > cmd = os.popen( 'foo.cmd' ) os.popen simply uses "cmd.exe" (or whatever your COMSPEC is, etc), so whatever behaviour you are seeing is cmd.exe at work. Have you tried: cmd = os.popen( os.path.abspath('foo.cmd') ) ? Mark.
- Previous message (by thread): asyncore: where is handle_timeout() ?
- Next message (by thread): does os.popen() search the path?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list