python code to convert integer strings between different bases