well both work
Your way to find the last element of ur list isnt wrong. But theres a more "pythonic" way.
You can select positions in lists in reverse way like Doug Fresh posted.
Reverse way means that starts from the end of the list.
list = [0, 1, "abc"]
lista[-1] -> "abc"
lista[-2] -> 1
The -1 -2 -3 etc are Positions not elements, elements are 0,1,"abc"
So in a list we can find positions the usual way a a or the reverse way a[-1] etc
Now if you want to delete an element from a list (even if i dont see the point in your example), in your question the second element, you can do:
pieces.remove('') # deletes the FIRST Element that matches in list, if element doesnt exist in list ValueError is raised, so if you had 2 empty strings like '', the first '' would be deleted.
pieces.pop(1) # deletes the Position 1 and returns it's element
pieces.del(1) # deletes position 1 (and it's element of course)
Anyway you dont have to use mine solution, importing os etc. As u did it, split the list and then just select the last element list[-1]