image

the sleepy snake

index :: path :: replace_drive

replace_drive(path, drive=, sep=os.sep)

replaces the drive part of a path and returns it

pathfilepath
drivethe new drive part ('a:' --no slashes)
septhe separator to use

Note: if drive is empty string the drive is removed, if the path has no drive part the drive part is added