title: Best way to return a value from a python script
body: <p>I wrote a script in python that takes a few files, runs a few tests and counts the number of total_bugs while writing new files with information for each (bugs+more).</p>
  
  <p>To take a couple files from current working directory:</p>
  
  <blockquote>
    <p>myscript.py -i input_name1 input_name2</p>
  </blockquote>
  
  <p>When that job is done, I'd like the script to 'return total_bugs' but I'm not sure on the best way to implement this.</p>
  
  <p>Currently, the script prints stuff like:</p>
  
  <pre><code>[working directory]
  [files being opened]
  [completed work for file a + num_of_bugs_for_a]
  [completed work for file b + num_of_bugs_for_b]
  ...
  [work complete]
  </code></pre>
  
  <p>A bit of help (notes/tips/code examples) could be helpful here.</p>
  
  <p>Btw, this needs to work for windows and unix.</p>