title: Stop KeyboardInterrupt reaching batch file processor
body: <p>I'm writing some code in Python 3 on Windows that looks like this:</p>
  
  <pre><code>try:
      do something that takes a long time
      (training a neural network in TensorFlow, as it happens)
  except KeyboardInterrupt:
      print('^C')
  print a summary of results
  still useful even if the training was cut short early
  </code></pre>
  
  <p>This works perfectly if run directly from the console with <code>python foo.py</code>.</p>
  
  <p>However, if the call to Python was within a batch file, it ends up doing all the above but then still spamming the console with the 'terminate batch job' prompt.</p>
  
  <p>Is there a way to stop that happening? By fully eating the ^C within Python, jumping all the way out of the batch file or otherwise?</p>