I would like to split "C:\My Work\Tester Related\A_B_C.txt" into [C:\, My Work, Tester Related, A, B, C, txt] in Python.
I just started learning Python. I did import os.path module, and played with some of the functions in the interactive prompt but was not able to get the desired result. Thanks for the help. I was able to use os.path.basename to get the file, but was not able to split the file into components based on the given delimiter '_'.
split(file_name,"_"). But you want it split on several delimiters. Hm._with theos.pathsepfirst. Then you'll have a normalized path of "C:\My Work\Tester Related\A\B\C.txt"*unpacking withsplit