> Anyone have any ideas?

l = "wisconsin_state.txt"
l.split(".")[0].split("_")[-1]

Explanation:
-------------------
the split(".")[0] part takes everything before the "."

the split("_")[-1] part selects in the last element in the list of
substrings which are separated by "_"

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to