I want to use '/' as a character in a filename when saving a file.
with open('first_part.whatever', 'w') as f:
f.write('file things')
f.close()
This will save a file as expected, but
with open('first_part/second_part.whatever', 'w') as f:
f.write('file things')
f.close()
will not.
FileNotFoundError: [Errno 2] No such file or directory: 'first_part/second_part.whatever'
is the error message, which is clear enough. Yet, I don't know how to say "I want the entire string to be the filename; treat the slashes as just another character, not as a new directory". How do I do that?