initial
This commit is contained in:
0
s_basic/util/__init__.py
Normal file
0
s_basic/util/__init__.py
Normal file
18
s_basic/util/io.py
Normal file
18
s_basic/util/io.py
Normal file
@@ -0,0 +1,18 @@
|
||||
"""
|
||||
This module provides utility functions and classed for I/O.
|
||||
"""
|
||||
|
||||
|
||||
class CharacterDevice(object):
|
||||
def __init__(self, file_):
|
||||
self._file = file_
|
||||
|
||||
def getc(self):
|
||||
return self._file.read(1)
|
||||
def ungetc(self, c):
|
||||
self._file.seek(-1, 1)
|
||||
def ungets(self, s):
|
||||
self._file.seel(-len(s), 1)
|
||||
def close(self):
|
||||
return self._file.close()
|
||||
|
Reference in New Issue
Block a user