global name input_table_2 is not defined?

In the Python Script (2:1) I'm seeing the above error; I have someting like [very much simplified] :

def MyFunc(mol):

    global input_table_2 #Error with or without this line

    queries_mols = input_table_2['Smarts']

    <do stuff>

    return result

m = input_table_1['target']

op = MyFunc(m)

Both input_table_1 and input_table_2 are listed in the workspace window.

In reality, MyFunc is being called via another function.

Any ideas?

BTW, I notice that print dir() gives:

['flow_variables', u'input_table_1', u'input_table_2', 'pandas']

So is the problem something to do with the unicode variable names?

Same problem here.

Trying to read from input_table gives: NameError: global name 'input_table' is not defined

print dir() gives: ['flow_variables', u'input_table', 'non_interactive_substrings', 'output_table']

All these values are listed in the workspace view correctly.

Ideas how to access input_table?

 

Regards,

Korbinian

There's obviously something going on here, but I did find a work-around:

it2 = vars()['input_table_2']

Then reference it2 instead of input_table_2

Cheers,

Steve.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.