SyntaxError: can't assign to function call win32com.
Hans Nowak
hnowak at cuci.nl
Thu Dec 2 16:37:25 EST 1999
On 2 Dec 99, Hans Nowak wrote:
> On 1 Dec 99, at 18:35, tiddlerdeja at my-deja.com wrote:
>
> > I'm trying to mirror this VB code (which works) with python code:
> >
> > objUser.DynamicProperty("BILLING_ADDRESS2") = "3 The Street"
> >
> > This code works in VB but in python I get the error:
> >
> > SyntaxError: can't assign to function call
> >
> > Can you tell me what syntax I need to use for python?
> >
> > Any help greatly appreciated. I don't want to have to use VB!
Oops, I didn't see the 'call win32com.client' part in the message
header. =/ I was assuming you wanted to mimick VB-like behavior in
Python, rather than calling VB stuff from Python. Still, the idea
applies (well, somewhat ;-)... you can try to write a wrapper class
which uses a dictionary-like approach to assign to, and read from,
properties. You'll need __getattr__ and __setattr__ for this though.
Hmm... it's probably best to stick with the other reply I saw. ^_^
--Hans Nowak (zephyrfalcon at hvision.nl)
Homepage: http://fly.to/zephyrfalcon
You call me a masterless man. You are wrong. I am my own master.
More information about the Python-list
mailing list