[Python] Set file properties in Python

Discussão em 'Python' iniciado por Stack, Agosto 3, 2025.

  1. Stack

    Stack Membro Participativo

    In Filemanager (Linux and Windows) I can right click a file and see its properties. I would like to set them using Python. It seems complicated. With os.stat(file) I can retrieve standard file properties, but I can not set (custom) properties. There seems to be a solutions, for C# Retrieve metadata column feilds , and for VisualBasic How do I add a custom property to a file using VBScript but I could not find anything for Python. Your help is much appreciated. Python is polymorphous, so I would expect :

    setattr(file, property_name, property_value)


    but this does not work.

    Continue reading...

Compartilhe esta Página