Forum Archive

Problem with python script

filippocld223

trying this code :

#coding: utf-8
import workflow
action_in = workflow.get_input()

if action_in.endswith('     ')==True :
    action_out='True'
else:
    pass 

workflow.set_output(action_out)

Editorial gives this error: NameError:line 10 name "action_out" is not defined

omz

You should set action_out to some default value before the if statement. If the condition isn't true, you never set action_out to any value, so it isn't defined. Alternatively, you could set it to a different value in the else part.

filippocld223

oh scuse me xD