Question

How do I search a file and double click in File Explorer?


Badge

Hi, I’m facing a roadblock in my automation task. Let’s say if I have a python file located in my Desktop/ProjectTesting/Conversion.py, how can I automate to open the file through a search in File Explorer and double clicking it?

I have tried File package open and Open Program. Both doesn’t run my python script. 

I’ve also tried using the Python package to open, execute and close. It doesn’t run.

However, when I double click on the file manually, it worked.

 

The python file uses the following:

import tabula
import pandas as pd
import os
 

for file_name in os.listdir("Data"):
    if file_name.endswith(".pdf"):

… etc

 

Any advice on how to 

  1. Open up file explorer to directory
  2. Loop through the files in directory to find for Conversion.py (select it)
  3. Double click on selected

 

Thank you!


0 replies

Be the first to reply!

Reply