(fname)
Callback example when we try to overwrite an existing screenshot.
Callback example when we try to overwrite an existing screenshot.
Callback example when we try to overwrite an existing screenshot .
def on_exists(fname):
    # type: (str) -> None
    """
    Callback example when we try to overwrite an existing screenshot.
    """

    if os.path.isfile(fname):
        newfile = fname + ".old"
        print("{} -> {}".format(fname, newfile))
        os.rename(fname, newfile)
def on_exists ( fname ) : # type: (str) -> None if os . path . isfile ( fname ) : newfile = fname + ".old" print ( "{} -> {}" . format ( fname , newfile ) ) os . rename ( fname , newfile )