from py2neo import Graph, Node, Relationship
l=["Vipul", "Vithal", "Yoga"]
hasage=["hasAge", "hasAge", "hasAge"]
age=[24,31,26]
g = Graph(password="Abc123")
tx = g.begin()
for item in l:
Vithal = Node("item", name=l[l.index(item)], hasage[l.index(item)]=age[l.index(item)])
tx.create(Vithal)
tx.commit()
我得到一个错误:
Vithal = Node("item", name=l[l.index(item)], hasage[l.index(item)]=age[l.index(item)])
SyntaxError: keyword can't be an expression
我正在尝试使用预定义列表中的值为节点创建属性名称。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐