import tagui as t
import datetime
import os
import urllib.request

if not os.path.exists(r'C:\Users\garv2\Desktop\SBI'): #SBI
    os.makedirs(r'C:\Users\garv2\Desktop\SBI')
if not os.path.exists(r'C:\Users\garv2\Desktop\PNB'): #PNB
    os.makedirs(r'C:\Users\garv2\Desktop\PNB')
if not os.path.exists(r'C:\Users\garv2\Desktop\INDIAN BANK'): #Indian Bank
    os.makedirs(r'C:\Users\garv2\Desktop\INDIAN BANK')
if not os.path.exists(r'C:\Users\garv2\Desktop\INDIAN OVERSEAS BANK'): #Indian OVERSEAS Bank
    os.makedirs(r'C:\Users\garv2\Desktop\INDIAN OVERSEAS BANK')
t.init(visual_automation = True,chrome_browser = True)
today=datetime.datetime.now()
yesterday=today -datetime.timedelta(days=1)
sdate=yesterday.strftime('%d/%m/%Y')
edate=today.strftime('%d/%m/%Y')
filename=today.strftime('%d.%m.%Y %H.%M.%S')
directory=os.getcwd()
t.url("https://corp.onlinesbi.com?saral/login.htm")
t.wait(5)
t.keyboard('[tab]')
t.wait(1)
t.keyboard('[esc]')
t.wait(1)
t.keyboard('[tab]')
t.wait(1)
t.keyboard('[esc]')
t.wait(2)
t.click('//*[@id="banking"]/div[2]/div/div/div/a') 
t.wait(4)
t.click('//*[@id="banner"]/div[2]/a')
t.wait(5)   
t.click('//*[@id="username"]')
t.type('//*[@id="username"]','29KRISHNAJI')
t.wait(4)
t.type('//*[@id="label2"]','TUTAC2017%[enter]')
t.wait(5)
t.click('//*[@id="contentDiv"]/div[2]/div[2]/div[4]/a')
path=r'C:\Users\garv2\Desktop\SBI\balance.jpeg'#PATH
balance="balance"+str(filename)
path=path.replace("balance",balance)
t.snap('page',path)
t.wait(3)
t.click('//*[@id="navbar"]/div[1]/a[1]')
t.wait(2)
t.click('//*[@id="contentDiv"]/div/div/div[2]/div[2]/div[2]/h3/a')
t.wait(2)
t.click('//*[@id="bydate"]')
t.wait(2)
t.click('//*[@id="startdate"]')
t.wait(2)
t.keyboard('[left]')
t.wait(2)
t.keyboard('[enter]')
t.wait(2)
t.click('//*[@id="iconExcel"]/span')
t.wait(3)
t.keyboard('[tab]')
t.keyboard('[enter]')
t.wait(5)
t.click('//*[@id="useful-links"]/div/ul/li[3]/a')
t.wait(5)
t.close()


t.init(visual_automation = True,chrome_browser = False)
t.keyboard('[win]r')
t.wait(4)
t.keyboard(directory)
t.wait(4)
t.keyboard('[enter]')
t.wait(4)
t.keyboard('[shift][f10] ')
t.wait(2)
t.keyboard('o')
t.wait(2)
t.keyboard('[down]')
t.wait(2)
t.keyboard('[enter]')
t.wait(2)
t.keyboard('[shift][f10]')
t.wait(2)
t.keyboard('o')
t.wait(2)
t.keyboard('d')
t.wait(2)
t.keyboard('[f3]')
t.wait(1)
t.keyboard('15 datemodified:today kind:=document ')
t.wait(3)
t.keyboard('[enter]')
t.wait(3)
t.keyboard('[down]')
t.wait(2)
t.keyboard('[down]')
t.wait(2)
t.keyboard('[up]')
t.wait(2)
t.keyboard('[ctrl]x')
t.wait(2)
t.keyboard('[alt][f4]')
t.wait(3)
t.keyboard('[win]r')
t.wait(2)
t.keyboard('[clear]')
t.wait(2)
t.keyboard(r'C:\Users\garv2\Desktop\SBI') #PATH
t.wait(1)
t.keyboard('[enter]')
t.wait(1)
t.keyboard('[ctrl]v')
t.wait(2)
t.keyboard('[shift][f10]')
t.wait(2)
t.keyboard('m')
t.wait(2)
name="Statement"+str(filename)
t.keyboard(name)
t.wait(2)
t.keyboard('[enter]')
t.wait(1)
t.keyboard('[alt][f4]')
t.close()


#State Bank
t.init(visual_automation = True,chrome_browser = True)
today=datetime.datetime.now()
yesterday=today -datetime.timedelta(days=1)
sdate=yesterday.strftime('%d/%m/%Y')
edate=today.strftime('%d/%m/%Y')
filename=today.strftime('%d.%m.%Y %H.%M.%S')
directory=os.getcwd()
t.url('https://www.onlinesbi.com/')
t.wait(5)  
t.keyboard('[tab]')
t.wait(1)
t.keyboard('[esc]')
t.wait(1)
t.keyboard('[tab]')
t.wait(1)
t.keyboard('[esc]')
t.wait(2)   
t.click('//*[@id="banking"]/div[2]/div/div/div/a')
t.wait(3)
t.click('//*[@id="banner"]/div[2]/a')
t.wait(3)
t.type('//*[@id="username"]','MAAAIR18')
t.wait(3)
t.type('//*[@id="label2"]',' MAASEPL%18C[enter]')
t.wait(5)
t.click('//*[@id="contentDiv"]/div[2]/div[2]/div[4]/a')
t.wait(7)
path=r'C:\Users\garv2\Desktop\SBI\balance.jpeg' #PATH
balance="balance"+str(filename)
path=path.replace("balance",balance)
t.snap('page',path)
t.click('//*[@id="navbar"]/div[1]/a[1]')
t.wait(2)
t.click('//*[@id="contentDiv"]/div/div/div[2]/div[2]/div[2]/h3/a')
t.wait(2)
t.click('//*[@id="bydate"]')
t.wait(3)
t.click('//*[@id="startdate"]')
t.keyboard('[left]')
t.wait(2)
t.keyboard('[enter]')
t.click('//*[@id="iconExcel"]/span')
t.wait(3)
t.keyboard('[tab]')
t.keyboard('[enter]')
t.wait(5)
t.click('//*[@id="useful-links"]/div/ul/li[3]/a')
t.wait(5)
t.close()


t.init(visual_automation = True,chrome_browser = False)
t.keyboard('[win]r')
t.wait(4)
t.keyboard(directory)
t.wait(4)
t.keyboard('[enter]')
t.wait(4)
t.keyboard('[shift][f10] ')
t.wait(2)
t.keyboard('o')
t.wait(2)
t.keyboard('[down]')
t.wait(2)
t.keyboard('[enter]')
t.wait(2)
t.keyboard('[shift][f10]')
t.wait(2)
t.keyboard('o')
t.wait(2)
t.keyboard('d')
t.wait(2)
t.keyboard('[f3]')
t.wait(1)
t.keyboard('datemodified:today kind:=document ')
t.wait(3)
t.keyboard('[enter]')
t.wait(3)
t.keyboard('[down]')
t.wait(2)
t.keyboard('[down]')
t.wait(2)
t.keyboard('[up]')
t.wait(2)
t.keyboard('[ctrl]x')
t.wait(2)
t.keyboard('[alt][f4]')
t.wait(3)
t.keyboard('[win]r')
t.wait(2)
t.keyboard('[clear]')
t.wait(2)
t.keyboard(r'C:\Users\garv2\Desktop\SBI') #PATH
t.wait(1)
t.keyboard('[enter]')
t.wait(1)
t.keyboard('[ctrl]v')
t.wait(2)
t.keyboard('[shift][f10]')
t.wait(2)
t.keyboard('m')
t.wait(2)
name="Statement"+str(filename)
t.keyboard(name)
t.wait(2)
t.keyboard('[enter]')
t.wait(1)
t.keyboard('[alt][f4]')
t.close()




#State Bank
t.init(visual_automation = True,chrome_browser = True)
today=datetime.datetime.now()
yesterday=today -datetime.timedelta(days=1)
sdate=yesterday.strftime('%d/%m/%Y')
edate=today.strftime('%d/%m/%Y')
filename=today.strftime('%d.%m.%Y %H.%M.%S')
directory=os.getcwd()
t.url('https://www.onlinesbi.com/personal/sbi_home.html')
t.wait(5)
t.keyboard('[tab]')
t.wait(1)
t.keyboard('[esc]')
t.wait(1)
t.keyboard('[tab]')
t.wait(1)
t.keyboard('[esc]')
t.wait(2)
t.click('//*[@id="login_click"]/a')
t.wait(3)
t.click('//*[@id="banner"]/div[2]/a')
t.wait(3)
t.type('//*[@id="username"]','SEPLJNPT18')
t.wait(3)
t.type('//*[@id="label2"]',' JNPT1974%[enter]')
t.wait(10)
t.click('//*[@id="d-content"]/div/div[4]/span[1]/input[2]')
t.wait(4)
t.click('//*[@id="wrapper"]/div[3]/div[2]/div[2]/div[4]/a')
t.wait(4)
path=r'C:\Users\garv2\Desktop\PNB\balance.jpeg'  #PATH
balance="balance"+str(filename)
path=path.replace("balance",balance)
t.snap('page',path)
t.click('//*[@id="quick_links_nh"]/li[2]/a')
t.wait(6)
t.click('//*[@id="datepicker1"]')
t.wait(2)
t.keyboard('[left]')
t.wait(2)
t.keyboard('[enter]')
t.wait(2)
t.click('//*[@id="datepicker2"]')
t.wait(3)
t.keyboard('[enter]')
t.wait(2)
t.click('//*[@id="excelformat"]')
t.wait(2)
t.click('//*[@id="Submit3"]')
t.wait(4)
t.click('//*[@id="headerContent"]/div[3]/div/a/span[2]')
t.wait(5)
t.close()



t.init(visual_automation = True,chrome_browser = False)
t.keyboard('[win]r')
t.wait(4)
t.keyboard(directory)
t.wait(4)
t.keyboard('[enter]')
t.wait(4)
t.keyboard('[shift][f10] ')
t.wait(2)
t.keyboard('o')
t.wait(2)
t.keyboard('[down]')
t.wait(2)
t.keyboard('[enter]')
t.wait(2)
t.keyboard('[shift][f10]')
t.wait(2)
t.keyboard('o')
t.wait(2)
t.keyboard('d')
t.wait(2)
t.keyboard('[f3]')
t.wait(1)
t.keyboard('15 datemodified:today kind:=document ')
t.wait(3)
t.keyboard('[enter]')
t.wait(3)
t.keyboard('[down]')
t.wait(2)
t.keyboard('[down]')
t.wait(2)
t.keyboard('[up]')
t.wait(2)
t.keyboard('[ctrl]x')
t.wait(2)
t.keyboard('[alt][f4]')
t.wait(3)
t.keyboard('[win]r')
t.wait(2)
t.keyboard('[clear]')
t.wait(2)
t.keyboard(r'C:\Users\garv2\Desktop\SBI') #PATH
t.wait(1)
t.keyboard('[enter]')
t.wait(1)
t.keyboard('[ctrl]v')
t.wait(2)
t.keyboard('[shift][f10]')
t.wait(2)
t.keyboard('m')
t.wait(2)
name="Statement"+str(filename)
t.keyboard(name)
t.wait(2)
t.keyboard('[enter]')
t.wait(1)
t.keyboard('[alt][f4]')
t.close()




#INDIAN OVERSEAS BANK
t.init(visual_automation = True,chrome_browser = True)
today=datetime.datetime.now()
yesterday=today -datetime.timedelta(days=1)
sdate=yesterday.strftime('%d/%m/%Y')
edate=today.strftime('%d/%m/%Y')
filename=today.strftime('%d.%m.%Y %H.%M.%S')
pm=today.strftime('%m')
py=today.strftime('%Y')
tdate=today.strftime('%d')
td=today.strftime('%A')
firstdate=datetime.datetime(int(py),int(pm) ,1)
firstday=firstdate.strftime('%A')
weekday=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
k=2
c=1
for x in weekday:
    if firstday in x:
        break
    c=c+1
    a=1
for y in weekday:
    if td in y:
        break
    a=a+1
for i in range(1,int(tdate)+1):
   if c>7:
        c=1
        k=k+1
     c=c+1
tr=k
directory=os.getcwd()
t.url("https://www.iobnet.co.in/index.html")
t.wait(5)
t.keyboard('[tab]')
t.wait(1)
t.keyboard('[esc]')
t.wait(1)
t.keyboard('[tab]')
t.wait(1)
t.keyboard('[esc]')
t.wait(2)
t.click('//input[@value="Continue"]')
t.wait(4)
t.click('//*[@id="content"]/table[2]/tbody/tr/td[1]/a[2]/img')
t.wait(5)
t.type('//input[@name="loginId"]','SHAHITUT')
t.wait(2)
t.type('//input[@name="userId"]','SHAHITUT')
t.wait(2)
t.type('//input[@name="password"]','SHAHI1974x%')
t.wait(3)
t.click('//input[@name="corplogin"]')
t.wait(5)
t.keyboard('[tab]')
t.wait(1)
t.keyboard('[esc]')     
t.wait(1)
t.keyboard('[tab]')
t.wait(1)
t.keyboard('[esc]')
t.wait(4)
t.click('//*[@id="nav"]/li[1]/a')
t.wait(2)
path=r'C:\Users\garv2\Desktop\INDIAN OVERSEAS BANK\balance.jpeg'#PATH
balance="balance"+str(filename)
path=path.replace("balance",balance)
t.snap('page',path)
t.wait(2)
t.click('//*[@id="nav"]/li[3]/a')
t.wait(2)
t.select('//*[@id="accountNo"]','010002000011105')
t.wait(2)
t.click('//*[@id="tcalico_0"]')
t.wait(3)
tr2=tr
td2=a-1
if a==1:
    td2=7
    tr2=tr-1
    if tr==2:
        tr2=6
        t.click('//*[@id="tcal"]/table[1]/tbody/tr/td[2]/img')
        t.wait(2)
element1='//*[@id="tcal"]/table[2]/tbody/'+'/tr['+str(tr)+']/td['+str(td2)+']'
element2='//*[@id="tcal"]/table[2]/tbody/'+'/tr['+str(tr2)+']/td['+str(a)+']'
#print(element1)
#print(element2)
t.click(element1)
t.wait(3)
t.click('//*[@id="tcalico_1"]')
t.wait(3)
t.click(element2)
t.wait(3)
t.click('//*[@id="print"]')
t.wait(5)
x=t.url()
#print(x)
t.click('//*[@id="logo"]/table/tbody/tr/td[3]/table/tbody/tr[1]/td/h3/a[1]')
t.wait(5)
t.close()
if 'https://www.iobnet.co.in/ibanking/printstatement.do?' not in x:
    t.init(visual_automation = True,chrome_browser = False)
    t.keyboard('[win]r')
    t.wait(4)
    t.keyboard(directory)
    t.wait(4)
    t.keyboard('[enter]')
    t.wait(4)
    t.keyboard('[shift][f10] ')
    t.wait(2)
    t.keyboard('o')
    t.wait(2)
    t.keyboard('[down]')
    t.wait(2)
    t.keyboard('[enter]')
    t.wait(2)
    t.keyboard('[shift][f10]')
    t.wait(2)
    t.keyboard('o')
    t.wait(2)
    t.keyboard('d')
    t.wait(2)
    t.keyboard('[f3]')
    t.wait(1)
    t.keyboard('statement')
    t.wait(1)
    t.keyboard('[enter]')
    t.wait(2)
    t.keyboard('[down]')
    t.wait(2)
    t.keyboard('[down]')
    t.wait(2)
    t.keyboard('[up]')
    t.wait(2)
    t.keyboard('[ctrl]x')
    t.wait(2)
    t.keyboard('[alt][f4]')
    t.wait(3)
    t.keyboard('[win]r')
    t.wait(2)
    t.keyboard('[clear]')
    t.wait(2)
    t.keyboard(r'C:\Users\garv2\Desktop\INDIAN OVERSEAS BANK') #PATH
    t.wait(1)
    t.keyboard('[enter]')
    t.wait(1)
    t.keyboard('[ctrl]v')
    t.wait(2)
    t.keyboard('[shift][f10]')
    t.wait(2)
    t.keyboard('m')
    t.wait(2)
    name="Statement"+str(filename)
    t.keyboard(name)
    t.wait(2)
    t.keyboard('[enter]')
    t.wait(1)
    t.keyboard('[alt][f4]')
    t.close()






#Punjab National Bank
t.init(visual_automation = True,chrome_browser = True)
today=datetime.datetime.now()
yesterday=today -datetime.timedelta(days=1)
sdate=yesterday.strftime('%d/%m/%Y')
edate=today.strftime('%d/%m/%Y')
filename=today.strftime('%d.%m.%Y %H.%M.%S')
directory=os.getcwd()
t.url('https://internetbanking.netpnb.com/corp/AuthenticationController?FORMSGROUP_ID__=AuthenticationFG&__START_TRAN_FLAG__=Y&__FG_BUTTONS__=LOAD&ACTION.LOAD=Y&AuthenticationFG.LOGIN_FLAG=1&BANK_ID=024')
t.wait(5)
t.keyboard('[tab]')
t.wait(1)
t.keyboard('[esc]')
t.wait(1)
t.keyboard('[tab]')
t.wait(1)
t.keyboard('[esc]')
t.wait(2)
t.click('//*[@id="AuthenticationFG.CORP_ID"]') #corporate id
t.type('//*[@id="AuthenticationFG.CORP_ID"]', 'SHAH0073 ')
t.click('//*[@id="AuthenticationFG.USR_ID"]') #user id
t.type('//*[@id="AuthenticationFG.USR_ID"]', 'ANILA011[enter]')
t.wait(3)
t.click('//*[@id="AuthenticationFG.ACCESS_CODE"]')
t.type('//*[@id="AuthenticationFG.ACCESS_CODE"]', 'X%5755[enter]')
t.wait(3)
t.click('//*[@id="My-ShortCuts_Account-Summary"]')
t.wait(4)
path=r'C:\Users\garv2\Desktop\PNB\balance.jpeg'  #PATH
balance="balance"+str(filename)
path=path.replace("balance",balance)
t.snap('page', path)
t.click('//*[@id="My-ShortCuts_Account-Statement"]')
t.wait(3)
t.click('//*[@id="TransactionHistoryFG.FROM_TXN_DATE"]')
t.keyboard('[tab]')
t.dclick('//*[@id="TransactionHistoryFG.FROM_TXN_DATE"]')
t.keyboard('[clear]')
t.dclick('//*[@id="TransactionHistoryFG.FROM_TXN_DATE"]')
t.keyboard('[clear]')
t.dclick('//*[@id="TransactionHistoryFG.FROM_TXN_DATE"]')
t.keyboard('[clear]')
t.dclick('//*[@id="TransactionHistoryFG.FROM_TXN_DATE"]')
t.keyboard('[clear]')
t.dclick('//*[@id="TransactionHistoryFG.FROM_TXN_DATE"]')
t.keyboard('[clear]')
t.type('//*[@id="TransactionHistoryFG.FROM_TXN_DATE"]',sdate)
t.click('//*[@id="SEARCH"]')
t.wait(3)
check=0
if t.present('//*[@id="errorlink1"]/img')==True:
    check=1
t.select('//*[@id="TransactionHistoryFG.OUTFORMAT"]',"4")
t.click('//*[@id="okButton"]')
t.wait(10)
t.click('//*[@id="HREF_Logout"]')
t.wait(5)
t.close()

if check==0:
    t.init(visual_automation = True,chrome_browser = False)
    t.keyboard('[win]r')
    t.wait(4)
    t.keyboard(directory)
    t.wait(4)
    t.keyboard('[enter]')
    t.wait(4)
    t.keyboard('[shift][f10] ')
    t.wait(2)
    t.keyboard('o')
    t.wait(2)
    t.keyboard('[down]')
    t.wait(2)
    t.keyboard('[enter]')
    t.wait(2)
    t.keyboard('[shift][f10]')
    t.wait(2)
    t.keyboard('o')
    t.wait(2)
    t.keyboard('d')
    t.wait(2)
    t.keyboard('[f3]')
    t.wait(1)
    t.keyboard('Op')
    t.wait(1)
    t.keyboard('[enter]')
    t.wait(2)
    t.keyboard('[down]')
    t.wait(2)
    t.keyboard('[down]')
    t.wait(2)
    t.keyboard('[up]')
    t.wait(2)
    t.keyboard('[ctrl]x')
    t.wait(2)
    t.keyboard('[alt][f4]')
    t.wait(3)
    t.keyboard('[win]r')
    t.wait(2)
    t.keyboard('[clear]')
    t.wait(2)
    t.keyboard(r'C:\Users\garv2\Desktop\PNB') #PATH
    t.wait(1)
    t.keyboard('[enter]')
    t.wait(1)
    t.keyboard('[ctrl]v')
    t.wait(2)
    t.keyboard('[shift][f10]')
    t.wait(2)
    t.keyboard('m')
    t.wait(2)
    name="Statement"+str(filename)
    t.keyboard(name)
    t.wait(2)
    t.keyboard('[enter]')
    t.wait(1)
    t.keyboard('[alt][f4]')
    t.close()

#INDIAN BANK
t.init(visual_automation = True,chrome_browser = True)
today=datetime.datetime.now()
yesterday=today -datetime.timedelta(days=1)
sdate=yesterday.strftime('%d/%m/%Y')
edate=today.strftime('%d/%m/%Y')
filename=today.strftime('%d.%m.%Y %H.%M.%S')
t.url('https://www.indianbank.net.in:8443/jsp/startIB.jsp ')
t.wait(4)
t.click('//*[@id="corporatebanking"]')
t.wait(4)
t.keyboard("[tab]") #Agree
t.wait(1)
t.keyboard("[enter]")
t.wait(3)
t.keyboard("[tab]")
t.wait(3)
t.keyboard('132481977')
t.wait(3)
t.keyboard('[enter]')
t.wait(3)
t.keyboard('BLRAIR105x%')
t.wait(2)
t.keyboard('[enter]')
t.wait(6)
i=1                                      
while i<=3:
    t.keyboard('[tab]') #Value
    i=i+1
t.wait(2)
t.keyboard('[enter]')
#t.keyboard('[win][printscreen]')
t.wait(3)   
while i<=29:
     t.keyboard('[tab]') 
     i=i+1
t.wait(2)
t.keyboard('[enter]')
t.wait(6)
while i<=45:    
    t.keyboard('[tab]')
    i=i+1
t.wait(2)
t.keyboard('[enter]')
while i<=69:    
    t.keyboard('[tab]')
    i=i+1
t.wait(4)
t.keyboard(sdate)
t.wait(4)
t.keyboard('[tab]')
t.keyboard('[tab]')
t.keyboard(edate)
i=i+2
while i<=75: #download
    t.keyboard('[tab]')
    i=i+1   
t.wait(3)
t.keyboard('[enter]')
while i<=113: #logout
    t.keyboard('[tab]')
    i=i+1
t.wait(20)
t.keyboard('[enter]')
t.wait(5)
t.close() 

t.init(visual_automation = True,chrome_browser = False)
t.keyboard('[win]r')
t.wait(4)
t.keyboard('downloads')
t.wait(4)
t.keyboard('[enter]')
t.wait(4)
t.keyboard('[shift][f10] ')
t.wait(2)
t.keyboard('o')
t.wait(2)
t.keyboard('[down]')
t.wait(2)
t.keyboard('[enter]')
t.wait(2)
t.keyboard('[shift][f10]')
t.wait(2)
t.keyboard('o')
t.wait(2)
t.keyboard('d')
t.wait(2)
t.keyboard('[f3]')
t.wait(1)
t.keyboard('statement')
t.wait(1)
t.keyboard('[enter]')
t.wait(2)
t.keyboard('[down]')
t.wait(2)
t.keyboard('[down]')
t.wait(2)
t.keyboard('[up]')
t.wait(2)
t.keyboard('[ctrl]x')
t.wait(2)
t.keyboard('[alt][f4]')
t.wait(3)
t.keyboard('[win]r')
t.wait(2)
t.keyboard('[clear]')
t.wait(2)
t.keyboard(r'C:\Users\garv2\Desktop\INDIAN BANK') #PATH
t.wait(1)
t.keyboard('[enter]')
t.wait(1)
t.keyboard('[ctrl]v')
t.wait(2)
t.keyboard('[shift][f10]')
t.wait(2)
t.keyboard('m')
t.wait(2)
name="Statement"+str(filename)
t.keyboard(name)
t.wait(2)
t.keyboard('[enter]')
t.wait(1)
t.keyboard('[alt][f4]')
t.wait(2)
t.keyboard('[win]r')
t.wait(4)
t.keyboard('downloads')
t.wait(4)
t.keyboard('[enter]')
t.wait(4)
t.keyboard('[shift][f10] ')
t.wait(2)
t.keyboard('o')
t.wait(2)
t.keyboard('[down]')
t.wait(2)
t.keyboard('[enter]')
t.wait(2)
t.keyboard('[shift][f10]')
t.wait(2)
t.keyboard('o')
t.wait(2)
t.keyboard('d')
t.wait(2)
t.keyboard('[f3]')
t.wait(1)
t.keyboard('acc')
t.wait(1)
t.keyboard('[enter]')
t.wait(2)
t.keyboard('[down]')
t.wait(2)
t.keyboard('[down]')
t.wait(2)
t.keyboard('[up]')
t.wait(2)
t.keyboard('[ctrl]x')
t.wait(2)
t.keyboard('[alt][f4]')
t.wait(3)
t.keyboard('[win]r')
t.wait(2)
t.keyboard('[clear]')
t.wait(2)
t.keyboard(r'C:\Users\garv2\Desktop\INDIAN BANK') #PATH
t.wait(1)
t.keyboard('[enter]')
t.wait(1)
t.keyboard('[ctrl]v')
t.wait(2)
t.keyboard('[shift][f10]')
t.wait(2)
t.keyboard('m')
t.wait(2)
name="Balance"+str(filename)
t.keyboard(name)
t.wait(2)
t.keyboard('[enter]')
t.wait(1)
t.keyboard('[alt][f4]')
t.close()




