How can I split and parse a string in Python?
“2.7.0_bf4fda703454”.split(“_”) gives a list of strings: This splits the string at every underscore. If you want it to stop after the first split, use “2.7.0_bf4fda703454”.split(“_”, 1). If you know for a fact that the string contains an underscore, you can even unpack the LHS and RHS into separate variables: An alternative is to use partition(). … Read more