0

i have written a script which is searching automatically for a file.exe file in my root directory (like C:/root/). I have a lot of subfolders in the root directory and also a lot of file.exe files there. My scipt is able to detect all file.exe files but how can i get the full path of every file.exe found in the subfolders ? Is there any function which can return me the path so i can store it into a list ?

thanks for help

HightronicDesign
  • 699
  • 1
  • 9
  • 15
  • 1
    Possible duplicate : http://stackoverflow.com/questions/51520/how-to-get-an-absolute-file-path-in-python and here is what you're looking for : https://docs.python.org/3.4/library/os.path.html#os.path.abspath – Depado Apr 07 '15 at 09:22
  • can you share you code, so we can see and guide you with you current code? – Hackaholic Apr 07 '15 at 09:59

1 Answers1

0

Use os module for this:- os.path.abspath(path)

Barun Sharma
  • 1,452
  • 2
  • 15
  • 20