title: How should I indicate that my Python shell script is returning an error?
body: <p>I’m writing a shell script in Python (<code>#!/usr/bin/env python</code>). I’m a bit new to shell scripting in general, so apologies if I’m misunderstanding something.</p>
  
  <p>My current understanding is that if my shell script works successfully, I should call <code>sys.exit()</code> to indicate that it’s succeeded (i.e. return 0).</p>
  
  <p>If I’ve encountered an error (specifically, that the user has passed in an argument that I’m not expecting), what should I return, and how?</p>
  
  <p>Is it okay just to call <code>sys.exit()</code> with any non-zero value, e.g. <code>sys.exit(1)</code>?</p>