Looking for a graph (as in network, nodes) package

John Henry john106henry at hotmail.com
Sun Nov 19 21:56:53 EST 2006


Learn something new everyday.

Okay, when I run a test program:

import Graph

graph = Graph("1")


I got:

Traceback (most recent call last):
  File "E:\test\Graph\test_graph.py", line 3, in ?
    graph = Graph("1")
TypeError: 'module' object is not callable


Oh, wait....silly me.   Should have been:

from Graph import Graph

<bonk, bonk, bonk>

Must be a Sunday.

Thanks,



E:\test\Graph>

John Machin wrote:
> John Henry wrote:
> > I am looking for a ready made simple graph package.  I found an
> > extensive one in the piana package but when  I try to use just the
> > graph portion, it fails to load because of the line:
> >
> > class Graph(object):
>
> "fails to load" is insufficient information. Please provide the
> traceback and the actual error message.
>
> What version of Python are you using? That line should be OK from
> Python 2.2 onwards.
>
> >  ...
> >
> > It seems that their Graph is subclassed from "object" but I couldn't
> > find a "object" class anywhere.  So, I abandoned using that one.
> >
>
> object is built-in to Python. It is the uber-class from which new-style
> classes inherit.
> New-style classes were introduced in Python 2.2
>
> class Foo(object): # new-style class
> 
> class Bar: # old-style class




More information about the Python-list mailing list