Hi,
I am new user of python and now i am struck with a problem. Please help me in solving this.
I am trying to create a logfile for every action by using a standard template available.
My code is able to create & rename a log file by using template provided.But it is not able to write any thing is the excel.
Please help me out in knowing what would be the problem.
Below is my code.
import shutil,time,datetime
now = datetime.datetime.now()
strtime1=str(time.localtime()[3])+str(time.localtime()[4])+str(time.localtime()[5])
newfile="C:/"+"Resultlog"+str(strtime1)+".xls"
shutil.copyfile("C:/Template.xls",newfile)
tempname=open(newfile,"a")
tempname.write("starting Execution\n")
print "able to write inthe new file"
tempname.close()