MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / readline

Function readline

example_code/item_078.py:150–159  ·  view source on GitHub ↗
(handle)

Source from the content-addressed store, hash-verified

148 pass
149
150def readline(handle):
151 offset = handle.tell()
152 handle.seek(0, 2)
153 length = handle.tell()
154
155 if length == offset:
156 raise NoNewData
157
158 handle.seek(offset, 0)
159 return handle.readline()
160
161async def tail_async(handle, interval, write_func):
162 loop = asyncio.get_event_loop()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected