io

micvbang.io.here(*ps)[source]

Return script execution path os.path.join’ed with the given arguments.

micvbang.io.list_dir(path='.', dirs=False, files=True, ext=None, recursive=False)[source]

List the contents of a directory. If recursive is set to True, list_dir will recurse through sub-dirs as well.

Returns directories if dirs is set to True. Returns files if files is set True. Returns only files with the given extension if ext is set. Note that the extension includes the dot, i.e. ‘.jpg’.

micvbang.io.open(path, mode='r')[source]

Open a file and return a stream.

If the file has .gz extension, gzip.open is used in place of open.