0

I am trying to create a tree structure for a repository holding multiple folders using python. I know that it is traditionally done through Linux or Unix.

My question is, are there any modules I can use to achieve this easily. Or a function already created? I have attached an image to give a better understanding of what I am trying to accomplish.

enter image description here

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Victor Aguilar
  • 139
  • 1
  • 1
  • 6

1 Answers1

0

this is an example,you can use the 'os ' library

import os
Path='project'

fout=open('path.txt','w')
for Name in os.listdir(Path) :
   Pathname= os.path.join(Path,Name)
   print>>fout,Pathname
fout.close()
Renats Stozkovs
  • 2,549
  • 10
  • 22
  • 26
chenhong
  • 174
  • 2
  • 6