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

Discussion in 'Python' started by John Henry, Nov 20, 2006.

  1. John Henry

    John Henry Guest

    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):
    ...

    It seems that their Graph is subclassed from "object" but I couldn't
    find a "object" class anywhere. So, I abandoned using that one.

    Before I reinvent the wheel and start writing one myself, can somebody
    point me to a ready made one? I am afraid Googling "Python Graph"
    wouldn't be much help (millions and trillions of hits).

    Thanks,
    John Henry, Nov 20, 2006
    #1
    1. Advertising

  2. John Henry

    John Machin Guest

    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
    John Machin, Nov 20, 2006
    #2
    1. Advertising

  3. John Henry

    John Henry Guest

    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
    John Henry, Nov 20, 2006
    #3
  4. John Henry

    Guest

    John, networkx at networkx.lanl.gov


    John Henry wrote:
    > I am looking for a ready made simple graph package.
    , Nov 20, 2006
    #4
  5. John Henry

    John Henry Guest

    Thanks, downloading now.

    wrote:
    > John, networkx at networkx.lanl.gov
    >
    >
    > John Henry wrote:
    > > I am looking for a ready made simple graph package.
    John Henry, Nov 21, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Johnny Ooi

    Looking A Nodes From Within Nodes

    Johnny Ooi, Nov 13, 2004, in forum: XML
    Replies:
    10
    Views:
    652
    Johnny Ooi
    Nov 14, 2004
  2. Tom Plunket
    Replies:
    3
    Views:
    382
    Moshe Zadka
    Jul 8, 2003
  3. George Sakkis
    Replies:
    1
    Views:
    446
    Szabolcs Nagy
    Jan 29, 2007
  4. Dr Ann Huxtable

    Missing Graph.h and (Graph.lib) woes - any help

    Dr Ann Huxtable, Dec 21, 2004, in forum: C Programming
    Replies:
    6
    Views:
    648
    Dr Ann Huxtable
    Dec 21, 2004
  5. Emilio Mayorga
    Replies:
    6
    Views:
    326
    Martien Verbruggen
    Oct 8, 2003
Loading...

Share This Page