1
  1. I create the output folder inside the directory where the script is located
dirName = './output'

os.makedirs(dirName, exist_ok=True)
  1. I defined the name of the xlsx file that included the date:
from datetime import datetime

now = datetime.now()

datestr = now.strftime("%d%b%Y")

x = 'output_{}.xlsx'.format(datestr)
  1. This is the tricky part, since I cannot place x inside './output'
writer = pd.ExcelWriter(x, engine='xlsxwriter')

How can I create a path that includes the folder './output' where the x object should be placed?

vvvvv
  • 25,404
  • 19
  • 49
  • 81
George
  • 11
  • 1

0 Answers0