0

I have a Python GUI where I convert a .txt file to a .xlsx file. If any values are out of norm, then the script reformats those cells by highlighting the background and then I save the .xlsx file. When completed, I want to open the .xlsx file for the actual GUI user to be able to see and correct the highlighted cells.

Something like...

pandas.read_excel('foo.xlsx')

but literally opens the Excel application

1 Answers1

1
import os
file = 'foo.xlsx'
os.startfile(file)
bigwillydos
  • 1,321
  • 1
  • 10
  • 15
  • This will only work on `win32` platforms. For xnix/macos OP would need to use the `x-open` command with `popopen` – modesitt May 02 '19 at 23:16
  • 2
    @modesitt ... or `os.system()` or `subprocess.run()` perhaps: https://stackoverflow.com/questions/89228/calling-an-external-command-in-python – Clifford May 02 '19 at 23:20