def user_confirm(prompt, default=False):
 if default:
  prompt_default = '[Y/n]'
 else:
  prompt_default = '[y/N]'
 answer = input(('%s %s ' % (prompt, prompt_default)))
 if (answer == ''):
  return default
 else:
  return (answer.lower() in ('yes', 'y'))

def user_confirm ( prompt , default = False ) : if default : prompt_default = '[Y/n]' else : prompt_default = '[y/N]' answer = input ( ( '%s %s ' % ( prompt , prompt_default ) ) ) if ( answer == '' ) : return default else : return ( answer . lower ( ) in ( 'yes' , 'y' ) )
yes/no question dialog with user .