title: Error reading data from the old files, writing it into the new files and then deleting the old files in Python
body: <p>I'm trying to use below code to read 5 files from source, write them in destination and then deleting the files in source. I get the following error: <code>[Errno 13] Permission denied: 'c:\\data\\AM\\Desktop\\tester1</code>. The file by the way look like this: <a href="https://i.stack.imgur.com/vHxEL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vHxEL.png" alt="enter image description here"></a></p>
  
  <pre><code>import os
  import time
  
  source = r'c:\data\AM\Desktop\tester'
  destination = r'c:\data\AM\Desktop\tester1'
  
  
  for file in os.listdir(source):
      file_path = os.path.join(source, file)
      if not os.path.isfile:
          continue
      print(file_path)
  
  
  with open (file_path, 'r') as IN, open (destination, 'w') as OUT:
      data ={
              'Power': None,
              }
      for line in IN:
          splitter = (ID, Item, Content, Status) = line.strip().split()
          if Item in data == "Power":
              Content = str(int(Content) * 10)
  
  os.remove(IN)
  </code></pre>