X7ROOT File Manager
Current Path:
/opt/cloudlinux/venv/lib/python3.11/site-packages/future/types
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
future
/
types
/
ðŸ“
..
📄
__init__.py
(6.67 KB)
ðŸ“
__pycache__
📄
newbytes.py
(15.92 KB)
📄
newdict.py
(1.96 KB)
📄
newint.py
(13.04 KB)
📄
newlist.py
(2.23 KB)
📄
newmemoryview.py
(712 B)
📄
newobject.py
(3.28 KB)
📄
newopen.py
(810 B)
📄
newrange.py
(5.17 KB)
📄
newstr.py
(15.39 KB)
Editing: newopen.py
""" A substitute for the Python 3 open() function. Note that io.open() is more complete but maybe slower. Even so, the completeness may be a better default. TODO: compare these """ _builtin_open = open class newopen(object): """Wrapper providing key part of Python 3 open() interface. From IPython's py3compat.py module. License: BSD. """ def __init__(self, fname, mode="r", encoding="utf-8"): self.f = _builtin_open(fname, mode) self.enc = encoding def write(self, s): return self.f.write(s.encode(self.enc)) def read(self, size=-1): return self.f.read(size).decode(self.enc) def close(self): return self.f.close() def __enter__(self): return self def __exit__(self, etype, value, traceback): self.f.close()
Upload File
Create Folder