Re: python proxy checker ,change to threaded version

2009-12-08 Thread r0g
Lie Ryan wrote: > On 12/8/2009 8:43 AM, Rhodri James wrote: >>> >>> def run(self): >>> result = func(*func_args) # matching run_in_thread param names >>> callback(result, *callback_args) >> Neat, but I think you mean >> >> if callback is not None: >> callback(result, *callback_args) >> >> for that

Re: python proxy checker ,change to threaded version

2009-12-08 Thread Lie Ryan
On 12/8/2009 8:43 AM, Rhodri James wrote: def run(self): result = func(*func_args) # matching run_in_thread param names callback(result, *callback_args) Neat, but I think you mean if callback is not None: callback(result, *callback_args) for that last line. how about: import threading def

Re: python proxy checker ,change to threaded version

2009-12-07 Thread r0g
Rhodri James wrote: > On Mon, 07 Dec 2009 18:21:23 -, Terry Reedy wrote: > >> r0g wrote: >> >>> The trick to threads is to create a subclass of threading.Thread, define >>> the 'run' function and call the 'start()' method. I find threading quite >>> generally useful so I created this simple g

Re: python proxy checker ,change to threaded version

2009-12-07 Thread r0g
Terry Reedy wrote: > r0g wrote: > >> The trick to threads is to create a subclass of threading.Thread, define >> the 'run' function and call the 'start()' method. I find threading quite >> generally useful so I created this simple generic function for running >> things in threads... > > Great ide

Re: python proxy checker ,change to threaded version

2009-12-07 Thread r0g
Terry Reedy wrote: > r0g wrote: > >> The trick to threads is to create a subclass of threading.Thread, define >> the 'run' function and call the 'start()' method. I find threading quite >> generally useful so I created this simple generic function for running >> things in threads... > > Great ide

Re: python proxy checker ,change to threaded version

2009-12-07 Thread Terry Reedy
Rhodri James wrote: On Mon, 07 Dec 2009 18:21:23 -, Terry Reedy wrote: def run(self): result = func(*func_args) # matching run_in_thread param names callback(result, *callback_args) Neat, but I think you mean if callback is not None: callback(res

Re: python proxy checker ,change to threaded version

2009-12-07 Thread Rhodri James
On Mon, 07 Dec 2009 18:21:23 -, Terry Reedy wrote: r0g wrote: The trick to threads is to create a subclass of threading.Thread, define the 'run' function and call the 'start()' method. I find threading quite generally useful so I created this simple generic function for running things in

Re: python proxy checker ,change to threaded version

2009-12-07 Thread Terry Reedy
r0g wrote: The trick to threads is to create a subclass of threading.Thread, define the 'run' function and call the 'start()' method. I find threading quite generally useful so I created this simple generic function for running things in threads... Great idea. Thanks for posting this. def ru

Re: python proxy checker ,change to threaded version

2009-12-07 Thread elca
r0g wrote: > > elca wrote: >> Hello ALL, >> >> i have some python proxy checker . >> >> and to speed up check, i was decided change to mutlthreaded version, >> >> and thread module is first for me, i was tried several times to convert >> to >> thread version >> >> and look for many info, b

Re: python proxy checker ,change to threaded version

2009-12-07 Thread r0g
elca wrote: > Hello ALL, > > i have some python proxy checker . > > and to speed up check, i was decided change to mutlthreaded version, > > and thread module is first for me, i was tried several times to convert to > thread version > > and look for many info, but it not so much easy for novic

python proxy checker ,change to threaded version

2009-12-06 Thread elca
Hello ALL, i have some python proxy checker . and to speed up check, i was decided change to mutlthreaded version, and thread module is first for me, i was tried several times to convert to thread version and look for many info, but it not so much easy for novice python programmar . if anyon