FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Basic-Python-Programs/dirTree.py at main · gitishman/Basic-Python-Programs · GitHub
gitishman
/
Basic-Python-Programs
Public
forked from
souravjain540/Basic-Python-Programs
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Basic-Python-Programs
/
dirTree.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (26 loc) · 667 Bytes
Breadcrumbs
Basic-Python-Programs
/
dirTree.py
Copy path
File metadata and controls
29 lines (26 loc) · 667 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import
os
import
os
.
path
from
pathlib
import
Path
def
display
(
path
,
level
=
0
):
try
:
path
=
Path
(
path
)
except
:
print
(
"Enter right path"
)
return
k
=
os
.
listdir
(
path
)
for
i
in
k
:
if
os
.
path
.
isfile
(
os
.
path
.
join
(
path
,
i
)):
print
(
" "
*
level
,
"--F--"
,
i
)
elif
os
.
path
.
isdir
(
os
.
path
.
join
(
path
,
i
)):
print
(
" "
*
level
,
"+-D--"
,
i
)
display
(
os
.
path
.
join
(
path
,
i
),
level
=
level
+
1
)
else
:
print
(
i
)
return
if
__name__
==
"__main__"
:
print
(
"Enter a path"
)
s
=
input
()
if
s
==
""
:
s
=
os
.
getcwd
()
l
=
0
display
(
s
,
level
=
0
)
Back
|
FazBrowse Home
|
New Git URL