python xauth

Cousin Stanley cousinstanley at gmail.com
Mon Jul 11 02:48:26 EDT 2011


kracekumar ramaraju wrote:

> I am looking to use xauth in python ?
>
> It is for my command line process,
> I would like to have few examples 
> and resources.

    A simple example ....

>>> import subprocess as SP
>>> 
>>> proc = [ 'xauth' , 'list' , ':0' ]
>>> 
>>> pipe = SP.Popen( proc , stdout = SP.PIPE )
>>> 
>>> data = pipe.stdout.readline()
>>> 
>>> print '\n' , data

em1dsq/unix:0  MIT-MAGIC-COOKIE-1  10a533afab15a57c8704a16d1dc5bb12


-- 
Stanley C. Kitching
Human Being
Phoenix, Arizona




More information about the Python-list mailing list