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

php - How to serve a file for download on WordPress -

how to share virtual sharepoint server and get it in host windows and visual studio? -