# How to create filename containing date or time in Python # import modulefrom datetime import datetime  # get current date and timecurrent_datetime = datetime.now()print("Current date & time : ", current_datetime)  # convert datetime obj to stringstr_current_datetime = str(current_datetime)  # create a file object along with extensionfile_name = str_current_datetime+".txt"file = open(file_name, 'w')  print("File created : ", file.name)file.close()