[Twisted-Python] What is wrong with this instance?

Michał Tyde ajchos at wp.pl
Thu Aug 11 05:01:13 EDT 2005


As a topic. I got the code:
^^^
form twisted.protocols.telnet import Telnet

def keep():
	telnet=Telnet()
	print type(telnet)
	print getattr(telnet,'write')#all OK until here
	telnet.write("msg")
	print "msg"
keep()
^^^
and I got

TypeError: unbound method write() must be called with Telnet instance as
first argument (got str instance instead)

I really don't understand where is the mistake.





More information about the Twisted-Python mailing list