Recursive data stream problem

Hi community,

I tried to simplify the problem that I am facing. For the calculation of my python script I need the output of the python script. I thought I could handle this by scripting like this:

if x == None:
x =1

a = x+1

But no, I get following error message : Recursive data stream found, this component depends on itself. What this error message is saying is clear, will there be any way around for this?

Plugins like hoopsnake and anemone.

Simply write a recursive function inside your Python component! A recursive function is able to call itself until a condition is met.

Example:

def do_something(x):
    if x > 3:
         return x
    else:
        x += 1
        do_something(x)

As long as x is smaller than 3, the function do_something adds 1 to x and calls itself with the updated x-value. Starting at 0, the function is going to run recursively 3 times until it returns x (with a value of 3).