mysqlworkview.py 文件源码

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

项目:wikilinks 作者: trovdimi 项目源码 文件源码
def retrieve_all_unique_links(self):
            """retrieves all links. These are the network edges
            @return a list of dictionaries holding the following keys:
               'from': the source article id
               'to': the target article id
                    """
            links = []
            try:
                self._cursor.execute('SELECT * FROM unique_links;')
                result = self._cursor.fetchall()
                for row in result:
                    link = {}
                    link['from'] = row[0]
                    link['to'] = row[1]
                    links.append(link)
            except MySQLdb.Error, e:
                logging.error('error retrieving unique links %s (%d)' % (e.args[1], e.args[0]))
            return links
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号