import os
import fnmatch
def get_c_path():
for drive in ('C:\', 'D:\'):
for dirpath, dirnames, filenames in os.walk(drive):
for name in filenames:
if fnmatch.fnmatch(name, 't.py'):
path_app = os.path.join(dirpath, name)
if os.path.isfile(path_app):
return path_app