For consistency's sake with the rest of the code, using `os.path.basename` here would probably be good.

Also, there is an `os.path.dirname`, and it's the opposite of what you're doing (it's the base of the directory path), not the name--I believe).  So changing this variable name is probably for the best (perhaps to `dir_name`)