A nicer API around sockets.
Project description
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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sockless-0.8.0.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for sockless-0.8.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbdbbc54ebec756d9d37dd00ebec49505bbc708f30fac2ecc44fabebfa0f9d81 |
|
MD5 | 4df00cbe2c5b77cba7c36b35e2adfd7f |
|
BLAKE2b-256 | dbb8468b1c5c9223ae3c10735d146d1f283678f4f41ce5c6af35f541809a6fe9 |