os.path.join(dir_name, base_filename + "." + filename_suffix) 

Read more of this post