Hello guys, i have managed to take some values from a text file and import them to a DB
now i need to close the file and delete it, it would be ok if just close it.
that way can overwrite the same file,
what Im getting is that the file is been use by java, i have tried to file.close but it says list object has no attribute close
Have a clue of what can i do?
Thanks
adir = 'C:\\Control\\'
rFile = open(adir + 'kappa240.txt', 'r').readlines()
job = rFile[0].replace("job=", "")
product = rFile[1].replace("circuit=", "")
quantity = rFile[2].replace("quantity=", "")
print job, product, quantity
system.db.runUpdateQuery("INSERT INTO wokappa240 (job, circuit, qty) values (%s,%s,%s)" %(job, product, quantity))
rFile.close()
import os
os.remove("rFile")