database.py 文件源码

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

项目:betting-crawler 作者: HaraldNordgren 项目源码 文件源码
def __init__(self):

        self.log = open('.database_actions.log', 'a')

        self.database_name  = "odds_data"
        self.matches_table  = "matches"

        self.odds_cols      = ['1', 'X', '2']
        self.timestamp_col  = "timestamp"

        self.teams          = teams()

        try:
            self.connect()

        except psycopg2.OperationalError:
            self.create_database()
            self.connect()

        self.cursor = self.connection.cursor(cursor_factory = psycopg2.extras.DictCursor)
        self.create_table()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号