skip to navigation
skip to content

sockless 0.9.1

A nicer API around sockets.

A friendlier interface to socket.

Emulates file-like objects.

import sockless


with sockless.open('irc.freenode.net:6665', mode='rw') as sock:
    # Writing.
    sock.write('NICK atestbot\r\n')
    sock.write('USER atestbot bot@aserver.com unused :atestbot\r\n')
    sock.write('JOIN #testbot\r\n')

    # Reading lines from a socket.
    for line in sock:
        if not line:
            break

        if 'End of /NAMES list' in line:
            print "Successfully connected & joined. Quitting."
            break

        print line.strip()

TODO

  • Tests
  • Docs
  • Python 3 support
 
File Type Py Version Uploaded on Size
sockless-0.9.1-py2.py3-none-any.whl (md5) Python Wheel 2.7 2015-04-11 4KB
sockless-0.9.1.tar.gz (md5) Source 2015-04-11 4KB