I have this code:
ip = "127.0.0.1"
sql = "select count(*) from radacct where nasipaddress=%s"
cur.execute(sql,ip)
But I get an error like
TypeError: not all arguments converted during string formatting
How can i pass the parameters to psycopg2 in the correct way?