Thank you. So it is the point that I've disregarded before.<br><br><div class="gmail_quote">2010/3/29 Bo Shi <span dir="ltr"><<a href="mailto:bs1984@gmail.com">bs1984@gmail.com</a>></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'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 <<a href="mailto:joson.prog@gmail.com">joson.prog@gmail.com</a>> wrote:<br>
<br>
> Hi all,<br>
><br>
> I'm puzzled by this code:<br>
><br>
> # -*- coding: utf-8 -*-<br>
> from twisted.web.client import reactor<br>
><br>
> f = open("test1.txt","w")<br>
> f.write("html")<br>
> reactor.run()<br>
><br>
</div><div class="im">> Then it won't write anything into test1.txt. When I deleted<br>
> "reactor.run()", it will write contents. It is interesting but I<br>
> don't know why the reactor blocks file writing.<br>
><br>
</div>> Best regards,<br>
><br>
> Joson<br>
<div><div></div><div class="h5">> _______________________________________________<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>
<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>