win32- system call - getting results back into python

Peter Hansen peter at engcorp.com
Sat May 7 15:20:58 EDT 2005


gregpinero at gmail.com wrote:
> I'm trying to call a system command "svnlook log \arms" from within
> python and process the results.  However I'm having trouble getting the
> results of the command back into python.  I'm using windows if that
> matters.

As "runes" pointed out, you are getting caught by the \a escape sequence.

A better solution in this particular case is to see that the SVN 
utilities all understand forward slashes just fine, so you can use 
"svnlook log /arms" and it should work.

Note that there is also a Python library that wraps the SVN interface so 
you could also skip the direct calls to svnlook and do this with Python 
calls instead.  Google for "pysvn" for more.

-Peter



More information about the Python-list mailing list