Forum Archive

Broken Logic?

techteej

Not quite sure If I'm doing this right, as when I call the function, nothing gets printed.

def search_files():
    dir_items = listdir(getcwd())
    query = v['searchbox'].text
    if query in dir_items:
        print 'IT WORKED'
    else:
        print 'IT DID NOT WORK'
JadedTuna

@techteej, probably your function gets interrupted somewhere. Add print statements after each line, like so:

def search_files():
    print 'ENTERING FUNCTION'
    dir_items = listdir(getcwd()) # from os module?
    print 'GOT FILES'
    query = v['searchbox'].text
    print 'GOT SEARCH TEXT'
    if query in dir_items:
        print 'OH HEY IT WORKED'
    else:
        print 'IT DIDNT WORK'