On 12/4/06, Calvin Spealman <[EMAIL PROTECTED]> wrote:
> On 4 Dec 2006 20:18:22 -0800, Linan <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > In javascript, code could be written like this:
> >
> > ...
> >
> > var _p=XMLHttpRequest();
> > _p.open('GET',url,true);
> > _p.send(null)
y, December 04, 2006 11:18 PM
To: python-list@python.org
Subject: Async callback in python
Hi,
In javascript, code could be written like this:
...
var _p=XMLHttpRequest();
_p.open('GET',url,true);
_p.send(null);
_p.onreadystateChange=function(){
At Tuesday 5/12/2006 01:18, Linan wrote:
t=T('aVerySlowSite','/')
asyncore.loop()
for i in range(0,10):
print '%d in main process' % i
time.sleep(1)
Suppose it's asynchronous, couple of '%d in main process' lines should
be mixed in the output of T.handle_read(), right?
On 4 Dec 2006 20:18:22 -0800, Linan <[EMAIL PROTECTED]> wrote:
> 3, If not, where to get the real one(s)?
After reading Calvin's mail, you may want to see
http://twistedmatrix.com/ . It's an assynchronous library built around
the concept of deferreds (think of callbacks). You may like it =).
Cya,
On 4 Dec 2006 20:18:22 -0800, Linan <[EMAIL PROTECTED]> wrote:
> Hi,
>
> In javascript, code could be written like this:
>
> ...
>
> var _p=XMLHttpRequest();
> _p.open('GET',url,true);
> _p.send(null);
> _p.onreadystateChange=function(){
> if(_p.ready
Did you flush the buffer?
It might be that the print statements are being called in the order you
expect but that they are all written to the screen only at the end.
I've had that happen before.
Cheers,
-T
Linan wrote:
> Hi,
>
> In javascript, code could be written like this:
>
> ...
>
> v
Hi,
In javascript, code could be written like this:
...
var _p=XMLHttpRequest();
_p.open('GET',url,true);
_p.send(null);
_p.onreadystateChange=function(){
if(_p.readyState==4)
cb(_p.responseText);
}
...
This basic A