The following print statement after the progress bar code works:
print ('\033[F\033[2K', end = '')
This does the following:
'\033[F' moves the cursor to the beginning of the previous line (the line where the progress bar was displayed).'\033[2K' Erases the entire current line.Thanks to https://perplexity.ai for the ANSI escape sequences!