ganadist

Untitled

Mar 5th, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. class XASessionEvents:
  2.     def OnLogin(self, *args):
  3.         print "OnLogin", args
  4.  
  5.     def OnLogout(self, *args):
  6.         print "OnLogout", args
  7.  
  8.     def OnDisconnect(self, *args):
  9.         print "OnDisconnect", args
  10.  
  11. import win32com
  12. import win32com.client
  13. import pythoncom
  14.  
  15. SERVER="demo.etrade.co.kr"
  16. PORT = 20001
  17.  
  18. USER=""
  19. PASS=""
  20. CERTPASSWD = ""
  21. SERVERTYPE = 1
  22. SHOWCERTERR = 1
  23.  
  24. XASession = win32com.client.Dispatch("XA_Session.XASession")
  25. win32com.client.WithEvents(XASession, XASessionEvents)
  26. XASession.ConnectServer(SERVER, PORT)
  27. XASession.Login(USER, PASS, CERTPASSWD, SERVERTYPE, SHOWCERTERR)
  28.  
  29. while True:
  30.     pythoncom.PumpWaitingMessages()
Advertisement
Add Comment
Please, Sign In to add comment