title: Login to SAP session by Python
body: <p>I used this script to login SAP session:</p>
  
  <pre><code>from subprocess import call
  import win32com.client
  import time
  import os
  
  GUIPath = 'C:/Program Files (x86)/SAP/FrontEnd/SAPgui/'
  WinTitle = 'SAP'
  Name = """PRD"""
  SID = 'PRD'
  InstanceNo = '01'
  
  shell = win32com.client.Dispatch("WScript.Shell")
  call(os.path.join(GUIPath, 'SAPgui.exe') + " " + Name + " " + InstanceNo)
  </code></pre>
  
  <p>however, it always return with the error:</p>
  
  <pre><code>hostname 'PRD' unknown
  check you application server name
  </code></pre>
  
  <p>anyone knows how to fix this?
  thanks</p>