How to Create a Folder and Excel File Using Python

Here is Simple Demonstration of the python code for creating the folder and Excel file .

Please Import the Neccessary Library mentioned in the code . Else Code might Not Work

# Import the Library required for the Program
import os
import datetime
#Importing the Workbook from the Openpyxl to Work with the Excel Workbook
from openpyxl import Workbook

#Function to create a Folder & Excel file with today's date.
def DT_File_create(src_path):
    time =
    time = time.strftime("__%m_%d_%Y")
    des_path = os.path.join(src_path, time)
    wb = Workbook()
    ws =
    ws.title = "titlename" + "/" + time + ".xlsx", )

#Calling the function 

Leave a Reply

Your email address will not be published.