+6  A: 

Remember what your mom taught you:

always flush()

(in python, sys.stdout.flush() followed by os.fsync())

Autopulated
I updated with what you said before the close() and still nothing.
see my second answer, your problem is actually with multiprocessing, and nothing to do with files :)
Autopulated
A: 

If you have opened the file with a file handle in Python, remember to close it when finished. eg

f=open("file")
....
f.write(....)
f.close()
ghostdog74
I close it in the if to update the checked.txt file.
or better still, use with open("file") as f: f.write()
Dave Kirby
A: 

Obviously, you forget to close the file upon finishing working with it. If you want to check the contents of the file before closing it, call the flush() method. Example:

file = open("hello.txt", "a")
file.write(...)
file.flush()      // force write on the disk
file.close()      // finished using the file, close it

Check you code, not all open files are closed in it.

Alex
I do close the file see in the if fileo.close()
Yeah. But see fileo = open(OutFile, 'a'), after which there is no close() call. This means, that on the last iteration the file won't be closed.
Alex
I'm not speaking of unhandled exceptions which may be thrown if ProxyList file doesn't exist. In this case you'll just get an exception printed in the terminal and no files will be updated.
Alex
I made the test so the the file should be updated twice so I should see the updates. I think I will start filemon and see what happens.
I recive the head from both samples but there is no write to file in Procmon. Just a log write after I CTR-C the script.
+2  A: 

Regarding the code: It looks like the actual problem is one relating to threads, not to files:

Whilst you are executing this code:

    for t in list:
        fileo.write(t + "\n")
    list = []
    fileo.close()
    fileo = open(OutFile, 'a')
    k = 0

list is being modified by the threads you have spawned. I don't know the details of how 'for x in y' works with threads, but I imagine it is missing out the elements added to the list after the body for loop has been executed the first time.

To solve this you need a mutex for list which you lock for the entirety of this for loop (until you have cleared the list), and which you lock whenever you are adding an item to the list.

Autopulated
Oh no... hell I haven't coded with threads for a long time. Yes and the problem is even more complicated, I shall put the answer when finished.
Ah yes, thanks to everyone.
+1  A: 
I have left every thread manage it's own writes to the file.
Maybe you should expand on the reason your previous code was wrong.
Georg