Python MySQLdb exceptions

后端 未结 2 1158
忘掉有多难
忘掉有多难 2021-02-14 19:19

Just starting to get to grips with python and MySQLdb and was wondering

  1. Where is the best play to put a try/catch block for the connection to MySQL. At the MySQ

2条回答
  •  死守一世寂寞
    2021-02-14 20:12

    I think that the connections and the query can raised errors so you should have try/excepy for both of them.

提交回复
热议问题