title: Qualcomm's QPST Automation Server in Python 2.7 using win32com module
body: <p>Python newbie here. So, please excuse if this has been asked before in a different format.</p>
  
  <p>I am trying to replicate the following perl snippet in Python using the win32com module. This snippet is provided by Qualcomm for easier automation of their tools.</p>
  
  <pre><code>use Win32::OLE;
  use Win32::OLE::Variant;
  $prod_id = "QPSTAtmnServer.Application"; # AppId for the Automation server.
  eval{ $qpst = Win32::OLE-&gt;GetActiveObject($prod_id)}; # Attempt to use a running instance.
  die "$prod_id not installed" if $@;
  unless (defined $qpst) { $qpst = Win32::OLE-&gt;new($prod_id, sub {$_[0]-&gt;Quit;}) or die "Cannot start $prod_id";} # Start a new instance. Call Quit when $qpst set to undef or script exits.
  if (defined $qpst)
  {
      $port = $qpst-&gt;GetPort("COM30001");
  }
  </code></pre>
  
  <p>The block of python code I have till now is as follows:</p>
  
  <pre><code>import win32com.client
  import time
  import os
  
  cmd = 'cls'
  os.system(cmd)
  cmd = 'start C:\\LAB\\exe\\pskill.exe QPSTConfig'
  os.system(cmd)
  cmd = 'start C:\\LAB\\exe\\pskill.exe QPSTServer'
  os.system(cmd)
  cmd = 'start C:\\LAB\\exe\\pskill.exe AtmnServer'
  os.system(cmd)
  time.sleep(2)
  _path = os.getcwd()
  qpst = win32com.client.Dispatch('QPSTAtmnServer.Application')
  time.sleep(5)
  if (qpst is None):
      print('Darn!')
  else:
      port = qpst.GetPort('30001')
      print(port)
  </code></pre>
  
  <p>and it throws the following error:</p>
  
  <p><em>Traceback (most recent call last):</em></p>
  
  <p><em>File "xxxx.py", line 20, in module</em></p>
  
  <pre><code>port = qpst.GetPort('30001')
  </code></pre>
  
  <p><em>TypeError: 'NoneType' object is not callable</em></p>
  
  <p>After reading a couple of posts it seems like the method (GetPort) is not registering as a method after all.</p>
  
  <p>Is that correct analysis?</p>
  
  <p>If yes, how do I make Python interpret it as a method?</p>
  
  <p>If not, what is going on here with the error?</p>
  
  <p>Thanks in advance for the help!</p>