def float_input(self, question, message='<STR_LIT>', default=None, required=True):
float_result = None<EOL>requiredFlag = True<EOL>while (float_result is None and requiredFlag):<EOL><INDENT>result = input('<STR_LIT>' % question)<EOL>if not result and not required:<EOL><INDENT>float_result = None<EOL>requiredFlag = False<EOL><DEDENT>if not result and default:<EOL><INDENT>float_result = default<EOL><DEDENT>if float_result is None and requiredFlag:<EOL><INDENT>try:<EOL><INDENT>float_result = float(result)<EOL><DEDENT>except ValueError:<EOL><INDENT>self.stdout.write(self.style.ERROR(message))<EOL>float_result = None<EOL><DEDENT><DEDENT><DEDENT>return float_result<EOL>
Method for floating point inputs with optionally specifiable error message.