Create function that similar to os.walk

Technology CommunityCategory: PythonCreate function that similar to os.walk
VietMX Staff asked 3 years ago
def print_directory_contents(sPath):
    import os                                       
    for sChild in os.listdir(sPath):                
        sChildPath = os.path.join(sPath,sChild)
        if os.path.isdir(sChildPath):
            print_directory_contents(sChildPath)
        else:
            print(sChildPath)