title: Get account summary details from interactive brokers using python
body: <p>I have some questions based on automated trading via IB using python.</p>
  
  <p>I can access to TWS, but when I am request for account summary I can't put them into constant variables to use it, I only received them as an printing output.</p>
  
  <p>Here my code:</p>
  
  <pre><code>from ib.ext.Contract import Contract
  from ib.ext.Order import Order
  from ib.opt import Connection, message
  
  def error_handler(msg):
      """Handles the capturing of error messages"""
      print "Server Error: %s" % msg
  
  def reply_handler(msg):
      """Handles of server replies"""
      print "Server Response: %s, %s" % (msg.typeName, msg)
  
  if __name__ == "__main__":
  
      tws_conn = Connection.create(port=4096, clientId=150)
      tws_conn.connect()
      tws_conn.registerAll(reply_handler)
  
      tws_conn.reqAccountSummary(119, "All", "TotalCashValue")
      time.sleep(4)
  </code></pre>
  
  <p>The output on the screen(cmd):</p>
  
  <pre><code>Server Response: accountSummary, &lt;accountSummary reqId=119,
  account=DU860294, tag=TotalCashValue, value=980232.77, currency=USD&gt;
  Server Response: accountSummary, &lt;accountSummary reqId=119,
  account=DUC00074, tag=TotalCashValue, value=610528.18, currency=USD&gt;
  Server Response: accountSummaryEnd, &lt;accountSummaryEnd reqId=119&gt;
  </code></pre>
  
  <p>My needed is to put all these informations into variables to use it in my program.</p>
  
  <p>Thanks in advance.</p>