title: Check if files are open (because of error: "text file busy") in Python
body: <p>I have a big pcap file, from which I filter out some packets with tshark, save them in new pcap files and put the filenames of the new pcap files in an array called "filename_array". At the end I delete all the files which are saved in the filename_array. But one file from this array is still open when the delete process starts and due to that the error "text file busy" occurs.</p>
  
  <p>So, a solution would be, to check, if all files of the array are closed. If it's true, I can delete all of them. How can I do this?</p>