I have a variable called dllName
that grabs the name of a dll that has been executed. Sometimes this dll is returned in the format of "kernel32.dll"
and sometimes as "C:\Windows\system32\kernel32.dll"
.
The path can vary, what I am trying to achieve is the stripping of the "C:\Windows\system32\"
.
EDIT: Extract file name from path, no matter what the os/path format
My question is not the same as this question, as os.path.basename and os.path.split do not work in this situation.
For os.path.split the head is empty and the tail contains the whole path?