[Twisted-Python] Interactive control of client?

Joel Boehland joel at memes.com
Fri Jun 20 17:58:20 MDT 2003


Hi,
I'm fairly new to Twisted, so this may 
be a stupid question, but that's never 
stopped me before! :-) Anyhow, I would 
like to be able to script a tcp client 
to play around with sending different 
protocol elements from within the python 
interpreter. To boil it down to a 
super-simple example I'll take the 
EchoClient example. Is there anyway to 
get a handle to that client and have it 
send different strings to the 
EchoServer. I'm imagining being able to 
do something like this in the python 
interpreter:

 >>>echoclient = SomeWayToGetClient(...)
 >>>echoclient.sendLine("blah")
 >>>echoclient.sendLine("bleh")

I'm assuming I would have to have the 
client run in another thread to be able 
to allow the python interpreter thread 
to run as well, but I'm not sure how I 
would do that. Any Info/help appreciated!

cheers,
Joel Boehland





More information about the Twisted-Python mailing list