title: How can I capture the return value of shutil.copy() in Python ( on DOS )?
body: <p>I am trying to record the success or failure of a number of copy commands, into a log file. I'm using <code>shutil.copy()</code> - e.g.</p>
  
  <pre><code>str_list.append(getbitmapsfrom) 
  game.bigbitmap = "i doubt this is there.bmp"
  str_list.append(game.bigbitmap)
  source = '\\'.join(str_list)
  shutil.copy(source, newbigbmpname)
  </code></pre>
  
  <p>I forced one of the copy commands in my script to fail, and it generated the error:</p>
  
  <p><code>[Errno 2] No such file or directory: 'X:\PJ_public\PJ_Services\BSkyB-PlayJam\Content\P_NewPortal2009\1.0.0\pframes\i doubt this is is there.bmp'</code></p>
  
  <p>This is great, but can I capture <code>"Errno 2 No such file or directory"</code> and write it to a log file? Does <code>shutil.copy()</code> return an integer value? - I don't see this described in the Python docs.</p>
  
  <p>I guess also I want to be able to capture the return value, so that the script doesn't bomb out on a copy failure - I'm trying to make it continue regardless of errors.</p>
  
  <p>Thanks.</p>