Python loves raising exceptions, which is usually great. But I\'m facing some strings I desperately want to convert to integers using C\'s atoi / atof semantics - e.g. atoi
Perhaps use a quick regex to grab only the first part of the string that can be considered numeric? Something like...
-?[0-9]+(?:\.[0-9]+)?
for floats and for ints just,
-?[0-9]+