Close file to delete

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")

I just figured out heres the code I used to read a text file insert values from text file to database and delete the file, hope it would be helpful for somebody

fo = open(r'c:\\folder\\file.txt')
lines = fo.readlines()
fo.close()
job = lines[0].replace("job=", "")
product = lines[1].replace("circuit=", "")
quantity = lines[2].replace("quantity=", "")
print job, product, quantity
system.db.runUpdateQuery("INSERT INTO csv (job, circuit, qty) values (%s,%s,%s)" %(job, product, quantity))
import os
os.remove('c:\\folder\\file.txt')