I would like to know how to check with python, if the filename\Directory the user has supplied to me, is acceptable (not include forbidden sings and so on) by the OS (Linux, Windows, Dos) ?
I am currently using Linux, but my goal with this question is to know if there is any library that would do that automatically, in accordance to the OS’s rules.
The usual approach in python is to assume everything is correct, but to catch any exceptions if you’re wrong (“Easier to ask for forgiveness than permission”).
So for this case, just try to do whatever you were doing with the filename, and if it’s not a valid filename you can catch the exception and alert the user then.