[solved] Using thread
I have a problem with this code that uses thread to produce a windows beep. I run OpenSesame from source, in order to avoid modules problems, but the problem is the same, irrespective of the installation.
lock = thread.allocate_lock()
# subsequently, in a part of the code...
thread.start_new_thread(windowsBeep,()) # produce a beep
The debug window doesn't return any error, simply the beep doesn't start. However, the cmd window returns this error:
Unhandles exception in thread started by
Traceback (most recent call last):
file "(string)", line 44, in windowsBeep
NameError: global name 'thread' is not defined
I noticed that, inside OpenSesame, you have to define global variables if you want to use them inside a function. Is the problem due to this aspect?
PS. If I use the winsound command, without the thread, the beep starts, but it doesn't works in as I would want, so the thread is important for me.
Do you have any suggestion?