By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,089 Members | 2,260 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,089 IT Pros & Developers. It's quick & easy.

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

P: n/a
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,

Nov 20 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a

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

Nov 20 '06 #2

P: n/a
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
Nov 20 '06 #3

P: n/a
John, networkx at networkx.lanl.gov
John Henry wrote:
I am looking for a ready made simple graph package.
Nov 20 '06 #4

P: n/a
Thanks, downloading now.

bo****@comcast.net wrote:
John, networkx at networkx.lanl.gov
John Henry wrote:
I am looking for a ready made simple graph package.
Nov 21 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.