abkai
abkai

Reputation: 591

Setting variable as returned list, doesn't seem to be doing anything

Setting variables as returned lists from functions that contain variables as a returned list doesn't seem to give me any output:

def get_wordlist(num, s):
    items_in_wordlist = database_get(num)
    print "Trying to get wordlist..."
    print items_in_wordlist
    items = []
    if s == 0:
        for item in items_in_wordlist:
            items.append((item[1]).decode("hex"))
        return items
    elif s == 1:
        for item in items_in_wordlist:
            items.append((item[2]).decode("hex"))
        return items

def get_wordlist_set(self, speed):
    global main_wordlist, main_wordlist_e
    print "Getting wordlist set..."
    #try:
    main_wordlist   = get_wordlist(speed, 1)
    print "Check (1) - Passed"
    main_wordlist_e = get_wordlist(speed, 0)
    print "Check (2) - Passed"
    return main_wordlist

"Check (*) - Passed" should be printed to the screen. However, All I am getting is "Getting wordlist set..." Any ideas as to what I'm doing wrong?

Upvotes: 0

Views: 50

Answers (1)

John La Rooy
John La Rooy

Reputation: 304315

As sandinmyjoints says, if you are seeing

Getting wordlist set...

But not

Trying to get wordlist...

It looks like

database_get(num)

isn't returning. It could also be that the same function name is used for a different function elsewhere. It might be a good idea to put a print before the call to database_get

Upvotes: 3

Related Questions