This is the new homepage for PyFilesystem.
It is a Wiki, and will be used to post examples / tips / news etc.
It supports syntax highlighting. Here's an example:
def openbin(self, path, mode="r", buffering=-1, **options):
_mode = Mode(mode)
_mode.validate_bin()
self.check()
_path = self.validatepath(path)
sys_path = self._to_sys_path(_path)
with convert_os_errors('openbin', path):
if six.PY2 and _mode.exclusive and self.exists(path):
raise errors.FileExists(path)
binary_file = io.open(
sys_path,
mode=_mode.to_platform_bin(),
buffering=buffering,
**options
)
return binary_file