Re: Tree structure

2011-07-26 Thread Bevan Jenkins
On Jul 26, 8:46 pm, Peter Otten <__pete...@web.de> wrote: > Bevan Jenkins wrote: > > Hello, > > > I am trying to create a tree structure for use with a PyQt QTreeView. > > But first I need to get my head around how to create the tree > > structure.  I have a dictionary (for testing purposes) but I

Re: Tree structure

2011-07-26 Thread Peter Otten
Bevan Jenkins wrote: > Hello, > > I am trying to create a tree structure for use with a PyQt QTreeView. > But first I need to get my head around how to create the tree > structure. I have a dictionary (for testing purposes) but I will > later use a table via sqlalchemy. > > The use case is hydr

Re: Tree structure

2011-07-26 Thread Marco Nawijn
On Jul 26, 6:53 am, Bevan Jenkins wrote: > Hello, > > I am trying to create a tree structure for use with a PyQt QTreeView. > But first I need to get my head around how to create the tree > structure.  I have a dictionary (for testing purposes) but I will > later use a table via sqlalchemy. > > Th

Re: Tree Structure

2009-10-10 Thread Shakeeb Alireza
> Is there any python class to display the drive and folder structure as > a tree(As you see in the windows explorer window)?? http://wiki.wxpython.org/TreeControls S -- http://mail.python.org/mailman/listinfo/python-list

Re: Tree Structure

2009-10-09 Thread r
On Oct 9, 5:02 am, Girish wrote: > Is there any python class to display the drive and folder structure as > a tree(As you see in the windows explorer window)?? You could use a recursive function to print it out of course or you will need to use a GUI kit. wxPython has a tree widget, i think TIX

Re: Tree structure consuming lot of memory

2009-07-06 Thread Chris Rebert
> On Tue, Jul 7, 2009 at 1:28 AM, Antoine Pitrou wrote: >> >> mayank gupta gmail.com> writes: >> > >> > After a little analysis, I found out that in general it uses about >> > 1.4 kb of memory for each node!! >> >> How did you measure memory use? Python objects are not very compact, but >> 1.4KB

Re: Tree structure consuming lot of memory

2009-07-06 Thread mayank gupta
I worked out a small code which initializes about 1,000,000 nodes with some attributes, and saw the memory usage on my linux machine (using 'top' command). Then just later I averaged out the memory usage per node. I know this is not the most accurate way but just for estimated value. The kind of N

Re: Tree structure consuming lot of memory

2009-07-06 Thread Antoine Pitrou
mayank gupta gmail.com> writes: > > After a little analysis, I found out that in general it uses about > 1.4 kb of memory for each node!! How did you measure memory use? Python objects are not very compact, but 1.4KB per object seems a bit too much (I would expect more about 150-200 bytes/object

Re: Tree structure consuming lot of memory

2009-07-06 Thread Simon Forman
On Mon, Jul 6, 2009 at 6:12 AM, mayank gupta wrote: > Thanks for the other possibilites. I would consider option (2) and (3) to > improve my code. > > But out of curiosity, I would still like to know why does an object of a > Python-class consume "so" much of memory (1.4 kb), and this memory usage

Re: Tree structure consuming lot of memory

2009-07-06 Thread mayank gupta
Thanks for the other possibilites. I would consider option (2) and (3) to improve my code. But out of curiosity, I would still like to know why does an object of a Python-class consume "so" much of memory (1.4 kb), and this memory usage has nothing to do with its attributes. Thanks Regards. On

Re: Tree structure consuming lot of memory

2009-07-06 Thread Chris Rebert
On Mon, Jul 6, 2009 at 2:55 AM, mayank gupta wrote: > Hi, > > I am creating a tree data-structure in python; with nodes of the tree > created by a simple class : > > class Node : >    def __init__(self , other attributes): >   # initialise the attributes here!! > > But the prob