title: cannot use ctypes to load a library
body: <p>I am kinda of new to python and I am trying to run a code using PyCharm 
  the first piece of the code is to load a dll file </p>
  
  <pre><code># python version &gt;= 2.5
  import sys,os
  import time
  import ctypes
  
  from ctypes import *
  
  try :
      if sys.platform.startswith('win32'):
          print 'we are in windows'
          libEDK = cdll.LoadLibrary("edk.dll")
      if sys.platform.startswith('linux'):
          srcDir = os.getcwd()    
          libPath = srcDir + "/libedk.so.1.0.0"        
          libEDK = CDLL(libPath)
  except :
      print 'Error : cannot load dll lib' 
  </code></pre>
  
  <p>the code file in the same folder as the dll files but I still getting the exception </p>
  
  <pre><code>Error : cannot load dll lib
  </code></pre>
  
  <p>the output is as following:</p>
  
  <pre><code>C:\Python27\python.exe "C:/Users/shehab/Downloads/Emotiv premium libraries v3.0.0.41/Examples/EpocExamples/examples_Python/emoStateLoger.py"
  we are in windows
  Traceback (most recent call last):
  Error : cannot load dll lib
    File "C:/Users/shehab/Downloads/Emotiv premium libraries v3.0.0.41/Examples/EpocExamples/examples_Python/emoStateLoger.py", line 22, in &lt;module&gt;
      EE_EmoEngineEventCreate = libEDK.EE_EmoEngineEventCreate
  NameError: name 'libEDK' is not defined
  
  Process finished with exit code 1
  </code></pre>
  
  <p>any clue ?</p>