walker.py 文件源码

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

项目:RDF2VecAtWebScale 作者: airobert 项目源码 文件源码
def my_cmd(self, query, flag):
        rst = commands.getoutput(query)
        print query
        rst = ''.join(rst) 
        rst = rst.split('\r')[-1]
        po = rst.split('\n')[:-1]
        # print po
        # print '\n\nsystem output 1 = \n' + rst
        # print po
        # print 'neighbours1',  neighbours1
        if flag:
            def p (x): return [x.split(' ')[1], x.split(' ')[2]]
        else :
            def p (x): return [x.split(' ')[1], x.split(' ')[0]]

        result = map(p, po)
        # print 'result = '
        # print result
        return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号