main.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:autopen 作者: autopen 项目源码 文件源码
def checkTrafficTable(self,table):

        found = 0

        db = MySQLdb.connect("localhost","root","toor", self.VEHICLE_NAME )
        # prepare a cursor object using cursor() method
        cursor = db.cursor()
        try:
            # Check if the tags database exists
            cursor.execute("SHOW TABLES LIKE '%s';" % table)
            results = cursor.fetchall()

            for row in results:
                if(row[0] == table):
                    found = 1

            # Commit your changes in the database
            db.commit()
        except:
            # Rollback in case there is any error
            db.rollback()

        db.close()

        return(found)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号