Cancel
Showing results for 
Search instead for 
Did you mean: 

Python Parser - How get Variable value?

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

How I can compare inside Python parser (yacc-file) any Variable Value with integer? I have error incompatible types...

 

For example, I want to compare #5 and 0:

 

        index = self.exprFactory.CreateVariableExpr('#5')
        if index > 0:

            some code

1 REPLY 1

Re: Python Parser - How get Variable value?

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Chigishev,

 

I am not sure, can you maybe cast the value before using it like:

 

if float(index) > 0

 

I am guessing only

Thomas Schulz
Siemens PLM
Manufacturing Engineering Software

Learn online





Solution Information