A Python function is called with (rounded) parantheses, the SPSS command to execute is a delimited string for Python, and SPSS commands are generally terminated by a full stop. Try
spss.Submit('compute flag=1 .')
If you need the effect immediatly, you may append
spss.Submit('execute .')
------------------------------
Kai Borgolte
------------------------------
Original Message:
Sent: Wed February 14, 2024 11:24 AM
From: Art Jack
Subject: python question
Morning, is there a way to compute a variable within a python block?
something equal to this [compute flag=1]
i was thinking spss.Submit[compute flag=1] but am getting an error. Thanks Art
------------------------------
Art Jack
------------------------------