Return an instance of the FileInput class, which can be iterated. The parameters are passed to the constructor of the FileInput class. The returned instance, in addition to being an iterator, keeps global state for the functions of this module,.
(files=None, inplace=False, backup="", *, mode="r", openhook=None,
encoding=None, errors=None)
| 76 | _state = None |
| 77 | |
| 78 | def input(files=None, inplace=False, backup="", *, mode="r", openhook=None, |
| 79 | encoding=None, errors=None): |
| 80 | """Return an instance of the FileInput class, which can be iterated. |
| 81 | |
| 82 | The parameters are passed to the constructor of the FileInput class. |
| 83 | The returned instance, in addition to being an iterator, |
| 84 | keeps global state for the functions of this module,. |
| 85 | """ |
| 86 | global _state |
| 87 | if _state and _state._file: |
| 88 | raise RuntimeError("input() already active") |
| 89 | _state = FileInput(files, inplace, backup, mode=mode, openhook=openhook, |
| 90 | encoding=encoding, errors=errors) |
| 91 | return _state |
| 92 | |
| 93 | def close(): |
| 94 | """Close the sequence.""" |
searching dependent graphs…