0

I want to open an excel file in Microsoft excel, and I don't want to do it using a mouse click but rather a python code. How can I do it?

Kundan
  • 590
  • 9
  • 21
  • Does this answer your question? [How to open external programs in Python](https://stackoverflow.com/questions/37238645/how-to-open-external-programs-in-python) – Tomerikoo Sep 13 '20 at 14:17

1 Answers1

2

You can use os.startfile

import os, subprocess
os.startfile(r'filepath') #For windows only
subprocess.call(['open', 'filepath']) #For MAC only
Equinox
  • 6,483
  • 3
  • 23
  • 32