title: python and sys.argv
body: <pre><code>if len(sys.argv) &lt; 2:
      sys.stderr.write('Usage: sys.argv[0] ')
      sys.exit(1)
  
  
  if not os.path.exists(sys.argv[1]):
      sys.stderr.write('ERROR: Database sys.argv[1] was not found!')
      sys.exit(1)
  </code></pre>
  
  <p>This is a portion of code I'm working on. The first part I'm trying to say if the user doesn't type <code>python programname something</code> then it will exit.</p>
  
  <p>The second part I'm trying to see if the database exists. On both places I'm unsure if I have the correct way to write out the sys.argv's by stderr or not.</p>