17 lines
392 B
Python
17 lines
392 B
Python
#! /usr/bin/env Python3
|
|
|
|
# import OS module
|
|
import os
|
|
|
|
def scandir_recursive(directory):
|
|
scan_list = []
|
|
for entry in os.scandir(directory):
|
|
if entry.is_dir(follow_symlinks=False):
|
|
yield from scandir_recursive(entry.path)
|
|
else:
|
|
yield entry.path
|
|
|
|
scan_path = "/home/jonnybravo/Downloads"
|
|
for i in list(scandir_recursive(scan_path)):
|
|
print(i)
|