I'm trying to find a way in Python to add metadata to a file. For example, if I wanted to add a property "source" with a value of "friend" to a file called "CookingRecipe.txt", the end result should be that when I right-click on "CookingRecipe.txt", go to Properties, and go to the "Details" tab, I should see a "Property" below called "source" followed by a "Value" right next to it called "friend".
Here is my code. When the file gets created, I don't see the "source" property with the "friend" value added.
f = open("CookingRecipe.txt", "x")
f.fileinfo = {'source': 'friend'}
f.close()
Please help and thank you very much!