import os root_dir = "D:\extention" for folder, subfolders, files in os.walk(root_dir): if folder != root_dir: for f in files: if f.endswith(".py"): print("File Name: ", f) print(f"Path: ", os.path.join(folder, f)) dir_path=(f"Path: ", os.path.join(folder, f)) with this code i can find py file in subfolder but cant run the file
I try to use os.system but get error.
I have very little knowledge of python can anyone help me.
os.systemin your example. And what is the error message?