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
Release files for sockless 0.9.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sockless-0.9.1.tar.gz | 4.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sockless-0.9.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 9.2 kB
Release files / sockless-0.9.1.tar.gz
| Download URL | sockless-0.9.1.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64e14d8607fb052479e4a2848ee84fba0d0f0da317672448606f5da38886fc82
|
|
BLAKE2b-256 checksum How to use checksums |
314e14ede9ac4543e4bd29570d5d5afb1da0553225f5c0fb555e8898400bce58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sockless-0.9.1-py2.py3-none-any.whl
| Download URL | sockless-0.9.1-py2.py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
7fcf71c80b47b7119c71fba0e18b2e942a63835b1c639c5ca85e06e126c45734
|
|
BLAKE2b-256 checksum How to use checksums |
3a29434a05ac2bd0602e5d4cccb68581540e20559466924f722e905989aac355
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |