Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Looking for a graph (as in network, nodes) package

Reply
Thread Tools

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

 
 
John Henry
Guest
Posts: n/a
 
      11-20-2006
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,

 
Reply With Quote
 
 
 
 
John Machin
Guest
Posts: n/a
 
      11-20-2006

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

 
Reply With Quote
 
 
 
 
John Henry
Guest
Posts: n/a
 
      11-20-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


 
Reply With Quote
 
boggom@comcast.net
Guest
Posts: n/a
 
      11-20-2006
John, networkx at networkx.lanl.gov


John Henry wrote:
> I am looking for a ready made simple graph package.


 
Reply With Quote
 
John Henry
Guest
Posts: n/a
 
      11-21-2006
Thanks, downloading now.

http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> John, networkx at networkx.lanl.gov
>
>
> John Henry wrote:
> > I am looking for a ready made simple graph package.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Boost Graph Library to create very large graph Almoni C++ 0 01-17-2010 05:13 AM
[Boost.Graph] graph.vertices property creates new objects George Sakkis Python 1 01-29-2007 11:09 PM
Help with initialization of graph (Boost Graph Library) Jef Driesen C++ 3 01-24-2006 01:44 PM
Missing Graph.h and (Graph.lib) woes - any help Dr Ann Huxtable C Programming 6 12-21-2004 11:15 AM
GD::Graph: "mixed" graph doesn't recognize "area" graph type Emilio Mayorga Perl Misc 6 10-08-2003 02:14 AM



Advertisments