Python on W2K server and dos batch files?

Max M maxm at mxm.dk
Wed Mar 6 17:33:28 EST 2002


Mark Kingston wrote:

> I would appreciate if you can tell me if Python is a good fit for what I
> want to do.  If not, please recommend another solution.

<snip>

All of the things you want to do looks absolutely feasible from Python.

Especially you should look at:

in module os

popen(command[, mode[, bufsize]])

Open a pipe to or from command. The return value is an open file object 
connected to the pipe, which can be read or written depending on whether 
mode is 'r' (default) or 'w'. The bufsize argument has the same meaning 
as the corresponding argument to the built-in open() function. The exit 
status of the command (encoded in the format specified for wait()) is 
available as the return value of the close() method of the file object, 
except that when the exit status is zero (termination without errors), 
None is returned. Availability: Unix, Windows.


regards Max M




More information about the Python-list mailing list