本文整理汇总了Python中Node.Node.property['category']方法的典型用法代码示例。如果您正苦于以下问题:Python Node.property['category']方法的具体用法?Python Node.property['category']怎么用?Python Node.property['category']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Node.Node
的用法示例。
在下文中一共展示了Node.property['category']方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: send
# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import property['category'] [as 别名]
metaAction.update(s.action())
s.reset()
self.send(metaAction)
def send(self,action):
params = json.dumps(action)
aSendURL = self.name()
if "127.0.0.1" in self.GEPHI_STREAM_URL or 'localhost' in self.GEPHI_STREAM_URL:
r= requests.post(aSendURL, data=params)
else:
r= requests.post(aSendURL, data=params)
def sendEntityAction(self,action,iGraphEntity):
if type(iGraphEntity) == Node or type(iGraphEntity) == Edge:
postAction = {action:iGraphEntity.object}
else:
postAction = {action:iGraphEntity}
self.send(postAction)
if __name__ == '__main__':
a = Node("A", red=1) # Create a node
a.property['category']= '1' # add a property
b = Node("B",blue=1) # Create a node
b.property['category']= '2' # add a property
e = Edge('A',b,True) # Create edge, can use Node type or Id of node for Source and Destination
t = GephiStreamerManager() # Streamer Manager (default http://localhost:8080/workspace0)
t.add_node(a)
t.add_node(b)
t.add_edge(e)
t.commit()
示例2: GephiStreamerManager
# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import property['category'] [as 别名]
'''
Created on 18 mars 2013
@author: Totetmatt
'''
from Node import Node
from Edge import Edge
from GephiStreamerManager import GephiStreamerManager
if __name__ == '__main__':
t = GephiStreamerManager()
a = Node("A", red=1)
a.property['start']= 2008
a.property['end']= 2010
t.add_node(a)
for i in range(1,10000):
b = Node("B%s"%i,blue=1)
b.property['category']= '2'
if i % 2 ==0:
b.property['start']=2008
else:
b.property['start']=2009
b.property['end']=2010
e = Edge('A',b,True)
t.add_node(b)
t.add_edge(e)
t.commit()