Python Forum
Parse XML - how to handle deep levels/hierarchy
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Parse XML - how to handle deep levels/hierarchy
#8
oops, that's one of mine,
here is is:
from pathlib import Path

class XMLpaths:
    def __init__(self):
        self.homepath = Path('.')
        self.rootpath = self.homepath / ('..')
        self.docpath = self.rootpath / 'doc'
        self.docpath.mkdir(exist_ok=True)
        self.datapath = self.rootpath / 'data'
        self.datapath.mkdir(exist_ok=True)
        self.xmlpath = self.datapath / 'xml'
        self.xmlpath.mkdir(exist_ok=True)

if __name__ == '__main__':
    '''
    running standalone once will create any missing directory, and will not harm any existing directories 
    '''
    XMLpaths()
Reply


Messages In This Thread
RE: Parse XML - how to handle deep levels/hierarchy - by Larz60+ - Apr-17-2018, 09:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  deep learning python Stevedas 1 1,771 Sep-26-2021, 08:32 AM
Last Post: Yoriz
  How can i generate hierarchy directory Anldra12 2 2,023 Jun-05-2021, 08:28 AM
Last Post: Anldra12
  [split] Teacher (thrown in at the deep end - help) Mr90 2 3,077 May-23-2018, 02:04 PM
Last Post: DeaD_EyE
  Teacher (thrown in at the deep end - help) Mr90 5 4,019 May-22-2018, 01:08 PM
Last Post: DeaD_EyE
  Relative import multiple levels ? Windspar 3 4,523 Feb-02-2018, 11:55 PM
Last Post: Windspar

Forum Jump:

User Panel Messages

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