Edmund
Edmund

Reputation: 63

str object not callable (sqlite3)

i keep getting the following when i run my program.

    look_date = "01-02-2018"
    cur.execute("SELECT item_id FROM hirers WHERE start_date=?," 
    (str(look_date),))
    -----------------------------------------------------------------
    TypeError: 'str' object is not callable

Upvotes: 1

Views: 438

Answers (2)

You can modify your code like this:

cur.execute("SELECT item_id FROM hirers WHERE start_date=?," 
((look_date,))

Upvotes: 0

internet_user
internet_user

Reputation: 3279

You have probably overwritten str with a variable named str, presumably another string.

Upvotes: 4

Related Questions