[python]how to get the size of a string before writing to a file
<p>for example:</p>

<p>I get a string:  str="please anwser my question",  i want to write it to a file.</p>

<p>but I need to know the size of the file before writing the string to the file.  what function can i use to calculate the size of the string.</p>
