[Zope-DB] Using xml-rpc and perl and external methods (and more...)

Dario Lopez-Kästen dario at ita.chalmers.se
Wed Aug 25 11:21:52 EDT 2004

Charlie Clark wrote:

>>>>r = os.popen("python test.py")
> 'hi\n' 
> I've called a little script that just prints "hi" and read its output. I'm 
> not sure if this is suitable for you but it should get you started.
> Good luck!

As it happens we use pipes to Perl to manage Kerberos accounts from 
Plone: here is the core of a method that does all the work:

from popen2 import popen3

def krb_cmd(kmd, arg):
     krb_out, krb_in, krb_err = popen3(kmd)
     out = krb_out.read()
     err = krb_err.read()
     res = (err,out)
     return res

kmd is the command I pipe to. arg is the arguments to that command.
krb_in is std_in to kmd, krb_out and krb_err are std_out and std_err to 
kmd, and I wrtie to krb_in and read from krb_err and krb_out.

Finally i return the results from std_err and std_out as a tuple of strings.

hope this helps.

BTW: Anyone knows of a real, working Python-Kerberos module?


-- -------------------------------------------------------------------
Dario Lopez-Kästen, IT Systems & Services Chalmers University of Tech.

More information about the Zope-DB mailing list