Python script optomisation

Well it appears I jumped the gun a little on the filepath error. I was running it in the script console which generated the error, but if I run it on an action performed button script, it runs perfectly for all cells including 152. Just for testing, I added 12 unique strings for all cells. It took 5 minutes 25 seconds to do 2.1M SQL entries. This is on a quad core (w/ht) i7 with 8GB ram, but the ram stayed stable and did not increase as the script ran. Speed isn’t a major issue anyway, as this script is going to run at 00:15 every day and look at yesterdays log files.

Next step is to copy this into a gateway tag change event script, triggered by a timer script;

[code]from time import localtime, strftime
curDay = strftime("%d", localtime())
curTime = strftime("%H:%M:", localtime())

if curTime == “00:15:”:
system.tag.write(‘FT/Trigger_logfile_analysis’, 1)

if curTime == “07:15:”:
system.tag.write(‘FT/Trigger_logfile_analysis’, 0)[/code]

But I need it to run for yesterdays date, not todays. There is an expression that can do this:

dateArithmetic(now(), -1, "days")

which handles potential start of month issues nicely, but is there any way to achieve this in python?