gopen#
- gwpy.io.utils.gopen(name, *args, **kwargs)[source]#
Open a file handling optional gzipping.
Deprecated since version 4.0.0: This function is deprecated and will be removed in a future release.
If
nameends with'.gz', or if the GZIP file signature is found at the beginning of the file, the file will be opened withgzip.open, otherwise a regular file will be returned fromopen.- Parameters:
- name
str,pathlib.Path path or name of file to open.
- *args, **kwargs
other arguments to pass to either
openfor regular files, orgzip.openfor gzipped files.
- name
- Returns:
- file
io.TextIoBase,file,gzip.GzipFile the open file object
- file