how to fetch the database table content in python