I am trying to get Python to curl working in my Ubuntu 11.04 box.
I did sudo apt-get install python-twisted
However, when I try to execute the following code:
from twisted.internet import protocol, reactor class Echo(protocol.Protocol): def dataReceived(self, data): self.transport.write(data) class EchoFactory(protocol.Factory): def buildProtocol(self, addr): return Echo() reactor.listenTCP(1234, EchoFactory()) reactor.run()
I get this error, which I cannot get at the bottom:
Traceback (most recent call last): File "eamorr.py", line 1, in <module> from twisted.internet import protocol, reactor File "/home/eamorr/Desktop/twisted.py", line 1, in <module> ImportError: No module named internet
Any help is most appreciated.
source share