Thank you. So it is the point that I&#39;ve disregarded before.<br><br><div class="gmail_quote">2010/3/29 Bo Shi <span dir="ltr">&lt;<a href="mailto:bs1984@gmail.com">bs1984@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Joson, this doesn&#39;t have anything to do with the reactor (aside from<br>
perhaps it forcing you to ctrl-c to stop the program).  You never 1.<br>
close() the file or 2. flush() the contents of the file to disk.<br>
<br>
Sent from my mobile phone.<br>
Please excuse any typos.<br>
<div class="im"><br>
On Mar 29, 2010, at 11:04, Joson Mandaro &lt;<a href="mailto:joson.prog@gmail.com">joson.prog@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Hi all,<br>
&gt;<br>
&gt; I&#39;m puzzled by this code:<br>
&gt;<br>
&gt; # -*- coding: utf-8 -*-<br>
&gt; from twisted.web.client import reactor<br>
&gt;<br>
&gt; f = open(&quot;test1.txt&quot;,&quot;w&quot;)<br>
&gt; f.write(&quot;html&quot;)<br>
&gt; reactor.run()<br>
&gt;<br>
</div><div class="im">&gt; Then it won&#39;t write anything into test1.txt. When I deleted<br>
&gt; &quot;reactor.run()&quot;, it will write contents. It is interesting but I<br>
&gt; don&#39;t know why the reactor blocks file writing.<br>
&gt;<br>
</div>&gt; Best regards,<br>
&gt;<br>
&gt; Joson<br>
<div><div></div><div class="h5">&gt; _______________________________________________<br>
&gt; Twisted-Python mailing list<br>
&gt; <a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
&gt; <a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</div></div></blockquote></div><br>