Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Opening Excel
#1
Hi,

I am generating a excel file with phyton. At the end I am saving the file but I would like it to also pup open in my face.

Does anyone know how to do it?

The code I am using is:

import os
import sys
sys.path.append(os.getcwd())
import pandas as pd
import numpy as np 
.
.
.
writer = pd.ExcelWriter('Test.xlsx', engine='xlsxwriter')
.
.
.
df.to_excel(writer, sheet_name=sheetname)
workbook  = writer.book
worksheet = writer.sheets[sheetname]
.
.
.
writer.save()


Thanks in advance
Reply
#2
Are you working under Windows?

You can try os.startfile('Test.xlsx').
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020