Python tweepy writing to sqlite3 db

后端 未结 2 1554
小鲜肉
小鲜肉 2021-01-28 16:24

My script below (taken from various resources online) isn\'t writing to the database. I do not get any errors, and if I comment out the database lines then it outputs to the co

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-28 16:29

    First, fix your indentation. You are not getting any errors, because you're explicitly silencing them! with

    except Exception, e:
        # Catch any unicode errors while printing to console
        # and just ignore them to avoid breaking application.
        pass
    

    This catches any exception that occurs in the try: except: block. Reading the Python Tutorial is a good start to learn more about exceptions.

提交回复
热议问题