I want to clean the name of a file but ONLY for the special characters not allowed:
char_not_supported_by_file_name = ['\', '/', ':', '*', '?', '"', '<', '>', '|']
tmp_file_name= file
for c in char_not_supported_by_file_name:
if c in tmp_file_name:
tmp_file_name = tmp_file_name.replace(c, '_')
I try to write this list, check if the file's name I want to clean up has one of the 9 special characters I don't want and replace it with an underscore, but my IDE says the array is written wrong. How can I write it in the correct way?