Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class XASessionEvents:
- def OnLogin(self, *args):
- print "OnLogin", args
- def OnLogout(self, *args):
- print "OnLogout", args
- def OnDisconnect(self, *args):
- print "OnDisconnect", args
- import win32com
- import win32com.client
- import pythoncom
- SERVER="demo.etrade.co.kr"
- PORT = 20001
- USER=""
- PASS=""
- CERTPASSWD = ""
- SERVERTYPE = 1
- SHOWCERTERR = 1
- XASession = win32com.client.Dispatch("XA_Session.XASession")
- win32com.client.WithEvents(XASession, XASessionEvents)
- XASession.ConnectServer(SERVER, PORT)
- XASession.Login(USER, PASS, CERTPASSWD, SERVERTYPE, SHOWCERTERR)
- while True:
- pythoncom.PumpWaitingMessages()
Advertisement
Add Comment
Please, Sign In to add comment