Python Base Conversion Method