qcodes/data/io.py
def open(self, filename, mode, encoding=None):
        """
        Mimic the interface of the built in open context manager.

        Args:
            filename (str): path relative to base_location.

            mode (str): 'r' (read), 'w' (write), or 'a' (append).
                Other open modes are not supported because we don't want
                to force all IO managers to support others.

        Returns:
            context manager yielding the open file
        """
        if mode not in ALLOWED_OPEN_MODES:
            raise ValueError(f'mode {mode} not allowed in IO managers')

        filepath = self.to_path(filename)

        # make directories if needed
        dirpath = os.path.dirname(filepath)
        if not os.path.exists(dirpath):
            os.makedirs(dirpath)

        # normally we'd construct this context manager with try/finally, but
        # here we already have a context manager for open so we just wrap it
        with open(filepath, mode, encoding=encoding) as f:
            yield f

        Mimic the interface of the built in open context manager.

        Args:
            filename (str): path relative to base_location.

            mode (str): 'r' (read), 'w' (write), or 'a' (append).
                Other open modes are not supported because we don't want
                to force all IO managers to support others.

        Returns:
            context manager yielding the open file
        
Mimic the interface of the built in open context manager.
Mimic the interface of the built in open context manager .
def open(self, filename, mode, encoding=None):
        if mode not in ALLOWED_OPEN_MODES:
            raise ValueError(f'mode {mode} not allowed in IO managers')
        filepath = self.to_path(filename)
        dirpath = os.path.dirname(filepath)
        if not os.path.exists(dirpath):
            os.makedirs(dirpath)
        with open(filepath, mode, encoding=encoding) as f:
            yield f
def open ( self , filename , mode , encoding = None ) : if mode not in ALLOWED_OPEN_MODES : raise ValueError ( f'mode {mode} not allowed in IO managers' ) filepath = self . to_path ( filename ) dirpath = os . path . dirname ( filepath ) if not os . path . exists ( dirpath ) : os . makedirs ( dirpath ) with open ( filepath , mode , encoding = encoding ) as f : yield f
Mimic the interface of the built in open context manager.
Mimic the interface of the built in open context manager .
"""
        Mimic the interface of the built in open context manager.

        Args:
            filename (str): path relative to base_location.

            mode (str): 'r' (read), 'w' (write), or 'a' (append).
                Other open modes are not supported because we don't want
                to force all IO managers to support others.

        Returns:
            context manager yielding the open file
        """ # make directories if needed # normally we'd construct this context manager with try/finally, but # here we already have a context manager for open so we just wrap it
context manager yielding the open file
context manager yielding the open file
self
filename
path relative to base_location.
path relative to base_location .
mode
None
encoding