Create function that similar to os.walk Technology Community › Category: Python › Create function that similar to os.walk 0 Vote Up Vote Down VietMX Staff asked 4 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)