def check_win_size(size):
 if (not size.strip()):
  return dict(valid=True, message='Window size not set (default)')
 size = size.lower()
 reg = '\\d{1,4}x\\d{1,4}'
 if (not re.match(reg, size, re.I)):
  msg = 'Try something like 720x480'
  return dict(valid=False, message=msg)
 else:
  return dict(valid=True, value=size)

def check_win_size ( size ) : if ( not size . strip ( ) ) : return dict ( valid = True , message = 'Window size not set (default)' ) size = size . lower ( ) reg = '\\d{1,4}x\\d{1,4}' if ( not re . match ( reg , size , re . I ) ) : msg = 'Try something like 720x480' return dict ( valid = False , message = msg ) else : return dict ( valid = True , value = size )
check window size input .