[Zope] telnetlib script help

Jack Coates jack at monkeynoodle.org
Sun Sep 7 00:09:43 EDT 2003


Hi,

I'm fair-to-middlin' with Perl and have no Python knowledge. I'm trying
to do a Python script which grabs some information from a telnet
interface on the same machine:

import sys
import telnetlib

HOST = "localhost"

tn = telnetlib.Telnet(HOST, 9090)

tn.write("title ?\n")
tn.write("album ?\n")
tn.write("artist ?\n")
tn.write("exit\n")

print tn.read_all()

That works from the command line (well, I'll be figuring out how to
regex-prettify the output later), but doesn't work from Zope: I've
enabled import of sys and telnetlib, but it now pops up auth dialogs
repeatedly. Hitting cancel makes it say "
Error Value: You are not allowed to access write in this context".

What am I doing wrong? I'm open to making it an external method, but
when I tried to do so it quit working from the command line.

thanks,
-- 
Jack Coates
Monkeynoodle: A Scientific Venture...




More information about the Zope mailing list