I have a bunch of Python arrays such as;
fileNameArray = ['fileName1', 'fileName2', 'fileName3']
titleArray = ['aTitle', 'bTitle', 'cTitle']
tagArray = ['abc', 'def', 'ghi', 'jkl', 'mno']
So, when I run the program, the output should be three files with names 'fileName1.mdx', 'fileName2.mdx', 'fileName3.mdx' with its content looking like;
---
title: 'aTitle'
Date Added: '2020-11-11'
summary: 'xyz.'
image: '/static/images/123.png'
tags: 'abc, def, ghi, jkl, mno'
---
When I run the program, how do I create a file named fileNamex.mdx with names coming from the fileNameArray, and its contents like title tag coming from the titleArray and tag key values coming from the tagArray.
Other keys like summary and image are static, that is the same values shown in the example should be on all files.
So, basically, how do I create files in Python (On Windows) and populate them with the initial content shown above?