using threads with python and winnt
Gordon McMillan
gmcm at hypernet.com
Sun Jan 16 13:21:40 EST 2000
Kreiner Karl or Charly or somebody wrote:
> does anyone have expiriences with using threads and winnt ? I
> started working with the built-in module "thread" using
> the function "start_new_thread" , which needs two parameters : a function
> and a list of araguments to be passed to the
> function. but no matter what I do , i just get the error-message:
>
> type error: first arg must be callable
>
> I consulted the python manual but it didn't provide help to my problem. so,
> does anyone know the correct syntax of this
> function and are there generally any problems with using the whole library
> with windows nt ?
Threads work dandy on NT (believe it or not, one of the better
thread implementations you'll find). You should probably be
using "threading" instead of "thread"; the latter is extremely
low level. As far as your problem goes, you're probably
spelling it wrong.
def func(arg)
# blah blah
Now "func" is a callable, but "func(1)" is an invocation which, if
it returns a callable will work, but that's probably not what
you're trying to do.
- Gordon
More information about the Python-list
mailing list