[python-win32] How to set value with PyIPropertyStore

Peng Chen capaneus at gmail.com
Thu Nov 7 17:33:46 EST 2019


Thanks Tim,
I tried:
    dateShifted = propsys.PyPROPVARIANT(
        mDate + shift_time.timedelta_obj, pythoncom.VT_DATE)
and it reports:
module 'win32comext.propsys.propsys' has no attribute 'PyPROPVARIANT'
Should I import it from elsewhere? because the import I had is
from win32comext.propsys import propsys, pscon

On Thu, Nov 7, 2019 at 7:26 PM Tim Roberts <timr at probo.com> wrote:

> Peng Chen wrote:
> > Hi Tim,
> >  Thanks for the reply. Sorry for the late. I just found your email
> > today. Yes I tried with this code:
> >
> > from win32comext.propsys import propsys, pscon
> > VIDEO_DATE_ENCODED = pscon.PKEY_Media_DateEncoded
> > properties = propsys.SHGetPropertyStoreFromParsingName(file_name)
> > mDate = properties.GetValue(VIDEO_DATE_ENCODED).GetValue() # got the
> > datetime object
> > dateShifted = mDate + shift_time.timedelta_obj # shift date
> > properties.SetValue(VIDEO_DATE_ENCODED, dateShifted) # set value
> > properties.Commit()
> >
> > and I got error message when executing to
> > properties.SetValue(VIDEO_DATE_ENCODED, dateShifted)
>
> I found it.  Try
>
>    dateShifted = propsys.PyPROPVARIANT(mData + shift_time.timedelta_obj,
> pythoncom.VT_DATE)
>
> --
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
>
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> https://mail.python.org/mailman/listinfo/python-win32
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20191107/76264c1d/attachment.html>


More information about the python-win32 mailing list