I am creating files dynamically in different folders, like so:
curr_dir = "/a/b/c" filename = os.path.join(curr_dir, 'file.text') Which gives me:
"/a/b/c/file.text" But because I am creating files with the same name in many folders, I want to distinguish them by adding the folder's name as a prefix, to get:
"a/b/c/c_file.text" How can I get that?