io - Python runs but won't write to file -


i want print variable file word_filter_output.txt. code runs fine , variable e prints console if want not print file. no errors come up. file left 0 bytes.

>>>with open("word_filter_output.txt", "w") f: >>>    print(e, file = f) 

it works given me (python 3.3.4);

depending on else doing, may need force-flush it, ie

with open("word_filter_output.txt", "w") f:     print(e, file=f, flush=true) 

Comments

Popular posts from this blog

What can cause "Required Package 'IndyCore' not found" when compiling a Delphi 2010 project? -

Change the color of an oval at click in Java AWT -