I have written a very simple program in Python 3.3, to delete some text from some files (several thousand).
When running it in the IDE, I get all the expected output in the interface. The compiled program doesn't print anything to the command line, but it does make the required changes to the files however.
Is this a problem with my code (below) or the configuration?
import os
import sys
filenames = os.listdir("XML")
print (len(filenames))
i = 0
for i in range (len(filenames)):
pathname = os.path.join("XML", filenames[i])
print (pathname)
fin = open(pathname, 'r')
lines = fin.read()
mediauri1 = lines.find("<mpeg7:MediaUri>")
mediauri2 = lines.find("http://",mediauri1)
fin.close()
fout = open(pathname, 'w+')
lines = lines.replace(lines [mediauri1+16:mediauri2], "")
fout.write(lines)
fout.close()
i = i+1