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
Post a Comment