I recently noticed that when I have the following code:
File = "/dir/to/file"
Content = "abcdefg"
with open(File,"a") as f:
f.write(Content)
I got "7" as the output, and this is the number of characters in the variable "Content". I don’t remember how I saw it (I used to use ipython notepad, but this time I did it in the python environment in the shell) and I wonder if I did something wrong. My python version: Python 3.3.3. Thank you for your help.
source
share