title: PyautoGUI- How to use If - Else with pyautogui.locateCenterOnScreen
body: <p>Essentially I want my Python script to perform this...</p>
  <pre><code>x = True
  if x  == True:
      print('Congratulations, you won!')
  else:
      print('I'm sorry but you lost.')
  </code></pre>
  <p>with this...</p>
  <pre><code>a, b = pyautogui.locateCenterOnScreen('~/home/file_01.png', region=(1065,250,385,700), confidence=0.9)
  </code></pre>
  <p>In other words, how can I have my script check to see if PyautoGUI has successfully located the center of <code>~/home/file_01.png</code>?</p>
  <p>See, about 95% of the time the following works correctly....</p>
  <pre><code>a, b = pyautogui.locateCenterOnScreen('~/home/file_01.png', region=(1065,250,385,700), confidence=0.9)
  </code></pre>
  <p>But about 5% of the time <code>~/home/file_01.png</code> does not exist. In those cases my script stops and throws off the following error message...</p>
  <pre><code>TypeError: cannot unpack non-iterable NoneType object
  </code></pre>
  <p>Instead of having my script stops in cases when <code>~/home/file_01.png</code> does not exist I would prefer that my script skip that instance. In other words, instead of stopping I want my script to ignore cases when <code>~/home/file_01.png</code> does not exist.</p>