MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap
Revision 5 as of 2014-02-26 16:25:30
  • Python
  • Twisted

Twisted

Twisted is an event-driven networking engine written in Python and licensed under the open source MIT license.

Install from source

  • su
  • cd /tmp
  • wget http://twistedmatrix.com/Releases/Twisted/13.1/Twisted-13.1.0.tar.bz2

  • tar xvif Twisted-13.1.0.tar.bz2
  • cd Twisted-13.1.0
  • python setup.py build
  • python setup.py install

Test installation

  • python
  • from twisted.internet import protocol, reactor
  • quit()

Slackbuild

  • su
  • cd /tmp
  • wget http://slackbuilds.org/slackbuilds/14.1/python/python-twisted.tar.gz

  • tar xvzf python-twisted.tar.gz
  • cd python-twisted
  • wget https://pypi.python.org/packages/source/T/Twisted/Twisted-13.2.0.tar.bz2

  • ./python-twisted.SlackBuild

  • installpkg /tmp/python-twisted-13.2.0-x86_64-1_SBo.tgz

Slackware64 14: python-twisted-13.2.0-x86_64-1_SBo.tgz

Echo server

   1 from twisted.internet import protocol, reactor
   2 
   3 class Echo(protocol.Protocol):
   4     def dataReceived(self, data):
   5         self.transport.write(data)
   6 
   7 class EchoFactory(protocol.Factory):
   8     def buildProtocol(self, addr):
   9         return Echo()
  10 
  11 reactor.listenTCP(1234, EchoFactory())
  12 reactor.run()
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01