Aggiunge esercizio 46
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import os
|
||||
|
||||
|
||||
def find(path, dir):
|
||||
if not os.path.isdir(path):
|
||||
return
|
||||
|
||||
for name in os.listdir(path):
|
||||
full_path = os.path.join(path, name)
|
||||
|
||||
if os.path.isdir(full_path):
|
||||
if name == dir:
|
||||
print(os.path.abspath(full_path))
|
||||
|
||||
find(full_path, dir)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
start_path = input("Percorso di partenza: ")
|
||||
directory_name = input("Directory da cercare: ")
|
||||
|
||||
find(start_path, directory_name)
|
||||
Reference in New Issue
Block a user