title: "EstablishContextException" error in Python
body: <p>I've downloaded <em>Python-2.7</em> and <em>pyscard-1.7.0.win32-py2.7</em> and installed them on my computer to use my ACR122U smart card reader in my Windows-7.</p>
  
  <p>After that I wrote the below program :</p>
  
  <pre><code>import sys
  import time
  sys.path.append("C:\\Python27\\Lib\\site-packages")
  
  from smartcard.scard import *
  import smartcard.util
  from smartcard.System import readers
  
  class Metro:
  
      isConnected = False
      isLoaded = False
      isAuthenticated = False
   .
   . # Methods censored.
   .
  </code></pre>
  
  <p>When I want to run the program, I receive these errors:</p>
  
  <pre><code>Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32
  Type "copyright", "credits" or "license()" for more information.
  &gt;&gt;&gt; ================================ RESTART ================================
  &gt;&gt;&gt; 
  &gt;&gt;&gt; Connecting to the reader: 
  
  Traceback (most recent call last):
    File "C:\Users\AmirEbrahim\Desktop\metro.py", line 195, in &lt;module&gt;
      m.connect()
    File "C:\Users\AmirEbrahim\Desktop\metro.py", line 63, in connect
      r = readers()
    File "C:\Python27\lib\site-packages\smartcard\System.py", line 41, in readers
      return smartcard.reader.ReaderFactory.ReaderFactory.readers(groups)
    File "C:\Python27\lib\site-packages\smartcard\reader\ReaderFactory.py", line 58, in readers
      zreaders += fm(groups)
    File "C:\Python27\lib\site-packages\smartcard\pcsc\PCSCReader.py", line 107, in readers
      hcontext = PCSCContext().getContext()
    File "C:\Python27\lib\site-packages\smartcard\pcsc\PCSCContext.py", line 53, in __init__
      PCSCContext.instance = PCSCContext.__PCSCContextSingleton()
    File "C:\Python27\lib\site-packages\smartcard\pcsc\PCSCContext.py", line 40, in __init__
      raise EstablishContextException(hresult)
  EstablishContextException: &lt;unprintable EstablishContextException object&gt;
  &gt;&gt;&gt;
  </code></pre>
  
  <p>What's wrong?</p>