Python Forum
Chain object that have parent child relation..
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Chain object that have parent child relation..
#6
@Gribouillis Thank you !

This is working great, and I discover defaultdict that is a relief to work with dict :)

now with
{'John': {'David': {'Grunt': {}}, 'Jade': {}}}
I would like to print a hierarchy
John
    - David
        - Grunt
    - Jade
The ultimate goal is to great an html output ~like this

<ul>
    
    <li>John
        <ul>
            <li>David
                <ul>
                    <li>Grunt</li>
                </ul>
            </li>
            <li>Jade</li>
          </ul>
    </li>
      </ul>
[Image: NfRQr9R.jpg]
Reply


Messages In This Thread
RE: Chain object that have parent child relation.. - by SpongeB0B - Dec-11-2023, 10:01 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Using one child class method in another child class garynewport 5 1,770 Jan-11-2023, 06:07 PM
Last Post: garynewport
  Find if chain of characters or number Frankduc 4 1,878 Feb-11-2022, 01:55 PM
Last Post: Frankduc
  How to access parent object attribute Pavel_47 2 9,013 Nov-19-2021, 09:36 PM
Last Post: deanhystad
  Can we access instance variable of parent class in child class using inheritance akdube 3 14,102 Nov-13-2020, 03:43 AM
Last Post: SalsaBeanDip
  How to Locate an Attribute's Parent Object? calvinsomething 5 3,085 Nov-13-2020, 01:52 AM
Last Post: calvinsomething
  Python3 binary tree not replacing parent nodes with child nodes Aspect11 0 1,836 Sep-23-2020, 02:22 PM
Last Post: Aspect11
  Getter/Setter : get parent attribute, but no Getter/Setter in parent nboweb 2 3,078 May-11-2020, 07:22 PM
Last Post: nboweb
  updating certain values in dict. with relation to their keys malevy 17 5,534 Nov-27-2019, 02:37 PM
Last Post: buran
  XML Parsing Child karthi_python 1 1,950 May-16-2019, 01:37 PM
Last Post: karthi_python
  logging: child module unable to get parent config jerryxiao 3 3,460 Apr-09-2019, 04:17 AM
Last Post: jerryxiao

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020