title: Opening a handle to a device in Python on Windows
body: <p>I'm trying to use the giveio.sys driver which requires a "file" to be opened before you can access protected memory.  I'm looking at a C example from WinAVR/AVRdude that uses the syntax:</p>
  
  <pre class="lang-c prettyprint-override"><code> #define DRIVERNAME      "\\\\.\\giveio"
   HANDLE h = CreateFile(DRIVERNAME,
              GENERIC_READ,
              0,
              NULL,
              OPEN_EXISTING,
              FILE_ATTRIBUTE_NORMAL,
              NULL);
  </code></pre>
  
  <p>but this does not seem to work in Python - I just get a "The specified path is invalid" error, for both</p>
  
  <pre><code>f = os.open("\\\\.\\giveio", os.O_RDONLY)
  </code></pre>
  
  <p>and </p>
  
  <pre><code>f = os.open("//./giveio", os.O_RDONLY)
  </code></pre>
  
  <p>Why doesn't this do the same thing?</p>
  
  <p><strong>Edited</strong> to hopefully reduce confusion of ideas (thanks Will).
  I did verify that the device driver is running via the batch files that come with AVRdude.</p>
  
  <p><strong>Further edited</strong> to clarify SamB's bounty.</p>