node.py 文件源码

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

项目:python_gray_8_9_11_12 作者: 3xp10it 项目源码 文件源码
def render_node_graphviz (self, graph):
        '''
        Render a node suitable for use in a Pydot graph using the set internal attributes.

        @type  graph: pgraph.graph
        @param graph: Top level graph object containing the current node

        @rtype:  pydot.Node
        @return: Pydot object representing node
        '''

        import pydot

        dot_node = pydot.Node(self.id)

        dot_node.label     = '<<font face="lucida console">%s</font>>' % self.label.rstrip("\r\n")
        dot_node.label     = dot_node.label.replace("\\n", '<br/>')
        dot_node.shape     = self.shape
        dot_node.color     = "#%06x" % self.color
        dot_node.fillcolor = "#%06x" % self.color

        return dot_node


    ####################################################################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号