Home > Mobile >  How to open python xlsx file as a spreadsheet?
How to open python xlsx file as a spreadsheet?

Time:12-25

I have a data.xlsx file. When i open it, a notepad window comes up with some data which is not human readable.
But when I right click on the file and select 'open with' microsoft excel then a window opens up in which I can see all the cells arranged (in grid format).
I want to open data.xlsx file in this format using python. How can i do this?

I tried using
import os
os.system("data.xlsx")
but this opens the file in the notepad format and not in the spreadsheet excel format.

CodePudding user response:

You can use python to run a terminal command to launch excel with the file as a parameter:

import os
os.system("start excel C:\path\to\file.xls")
  • Related