I'm trying to sort a list of files so that underscore chars are considered "later" than other ascii characters as seen in the example below (this is porting external software to python3). I'd like the sorting to account for file paths in the same way it was originally as to produce no diffs with the original sorting.
Requirements: Avoid 3rd party sorting modules if possible
files = sorted( files, key=lambda d: d['name'].lower() )
Example re-ordering which I'm trying to avoid
-/usr/wte/wte_scripts/wfaping.sh
/usr/wte/wte_scripts/wfa_test_cli.sh
+/usr/wte/wte_scripts/wfaping.sh
I've searched for similar examples of sorting and couldn't find anything concrete with the same issue.
Thanks