1# 2# Copyright (C) 2016 Intel Corporation 3# 4# SPDX-License-Identifier: MIT 5# 6 7import os 8import sys 9 10def findFile(file_name, directory): 11 """ 12 Search for a file in directory and returns its complete path. 13 """ 14 for r, d, f in os.walk(directory): 15 if file_name in f: 16 return os.path.join(r, file_name) 17 return None 18 19def remove_safe(path): 20 if os.path.exists(path): 21 os.remove(path) 22 23