Skip to content

Instantly share code, notes, and snippets.

@QuantTraderEd
Last active August 29, 2015 14:15
Show Gist options
  • Save QuantTraderEd/856dbbf61ffd675493d6 to your computer and use it in GitHub Desktop.
Save QuantTraderEd/856dbbf61ffd675493d6 to your computer and use it in GitHub Desktop.
TotalRun
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 05 10:43:47 2013
@author: Administrator
"""
import os
import time
import psutil
import pywinauto
def getProcessList():
prcslst = []
for proc in psutil.process_iter():
psinfo = proc.as_dict(attrs=['name'])
if psinfo['name']: prcslst.append(psinfo['name'])
return prcslst
print 'total run starting...'
prcslst = getProcessList()
if not ("DibServer.exe" in prcslst):
print 'start cybos....'
app = pywinauto.application.Application.start('C:\\DAISHIN\\starter\\ncStarter.exe')
time.sleep(30)
window = app.ncStarter
window.SetFocus()
ctrl = window['PLUSButton']
ctrl.Click()
ctrl = window['ONECLIKEdit2']
ctrl.DrawOutline()
ctrl.Click()
ctrl.SetEditText("h6626075")
ctrl = window['Button']
ctrl.DrawOutline()
time.sleep(3)
ctrl.SetFocus()
ctrl.Click()
time.sleep(10)
pass
prcslst = getProcessList()
if ("DibServer.exe" in prcslst):
print 'start ZeroTrader...'
commonfolder = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
time.sleep(5)
os.chdir(commonfolder + '\\ZeroTrader\\ZeroFeeder\\')
os.startfile('ZeroFeederMainForm.py')
time.sleep(10)
os.chdir(commonfolder + '\\ZeroTrader\\ZeroOptionViewer\\')
os.startfile('zerooptionviewer_main.py')
time.sleep(10)
os.chdir(commonfolder + '\\ZeroTrader\\ZeroOMS\\')
os.startfile('zerooms_main.py')
time.sleep(10)
os.chdir(commonfolder + '\\ZeroTrader\\ZeroOptionViewer\\')
os.startfile('optionview_db_test2.py')
print 'total run end...'
a = input()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment