[Twisted-Python] [twisted-python] a problem about reactor

Joson Mandaro joson.prog at gmail.com
Mon Mar 29 21:35:28 EDT 2010


Thank you. So it is the point that I've disregarded before.

2010/3/29 Bo Shi <bs1984 at gmail.com>

> Joson, this doesn't have anything to do with the reactor (aside from
> perhaps it forcing you to ctrl-c to stop the program).  You never 1.
> close() the file or 2. flush() the contents of the file to disk.
>
> Sent from my mobile phone.
> Please excuse any typos.
>
> On Mar 29, 2010, at 11:04, Joson Mandaro <joson.prog at gmail.com> wrote:
>
> > Hi all,
> >
> > I'm puzzled by this code:
> >
> > # -*- coding: utf-8 -*-
> > from twisted.web.client import reactor
> >
> > f = open("test1.txt","w")
> > f.write("html")
> > reactor.run()
> >
> > Then it won't write anything into test1.txt. When I deleted
> > "reactor.run()", it will write contents. It is interesting but I
> > don't know why the reactor blocks file writing.
> >
> > Best regards,
> >
> > Joson
> > _______________________________________________
> > Twisted-Python mailing list
> > Twisted-Python at twistedmatrix.com
> > http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20100330/c6d6568b/attachment.htm 


More information about the Twisted-Python mailing list