So I’m defining my compute_field-function that produce the information “info_for_click”

Then I’m calling the compute_field-function in my decision-function that is inside my main-function. Here the actual data for info_for_click gets computed. Then in the click_row-function (inside main) I would need access to the data info_for_click that was produced inside the compute_field-function inside my decision-function.

How do I do that? Thanks a lot in advance.

- Code: Select all
`def compute_field(s, A, phi, k, Vebit, Vebitmax, cavmaxreal, factor, betaS, minimumf, maximumf, diffE, E):`

…

if condition_field:

Qout.append(k)

fieldout.append(fieldreal)

numberout.append(s)

Energyout.append(E)

set_cells(table, len(Qout) - 1, k, Vebit, s, E)

# no provide information for click

info_for_click = zip(Qout, fieldout, numberout, Energyout)

return info_for_click

def main():

Qcont, A1, Around, nameiso, abu, qdivbya, abu2, information = readcontaminationfile()

cavmaxCSS, cavmaxreal, factor = readcavmaxfile()

phi, Qin, A, E, diffE, minimumf, maximumf, Vebitmax, check2, check1, check3, check4, checks,\

number, numbers, diffqa0, cavlist, combo = getInputs(A1, Around, nameiso, Qcont, factor)

alarm(cavlist, cavmaxCSS, number)

info_for_click = decision(phi, Qin, A, E, diffE, minimumf, maximumf, Vebitmax, checks, \

number, numbers, cavlist, factor, cavmaxCSS, cavmaxreal)

clickrow(Qcont, A1, nameiso, qdivbya, abu2, information, A, diffqa0, check3, check4, factor, \

phi, minimumf, maximumf, cavmaxreal, combo)

def decision(phi, Qin, A, E, diffE, minimumf, maximumf, Vebitmax, checks, \

number, numbers, cavlist, factor, cavmaxCSS, cavmaxreal):

Q = range(1 , Qin + 1, 1)

for i in Q:

Vebit = 12*A/i

# Ist possibility: fixed number, compute Energy

if checks == [1, 0, 0, 1]:

compute_energy(number, A, phi, i, cavlist, Vebit, Vebitmax, cavmaxCSS, factor, betaS)

elif checks == [1, 0, 1, 0]:

compute_field(number, A, phi, i, Vebit, Vebitmax, cavmaxreal, factor, betaS, minimumf, maximumf, diffE, E)

elif checks == [0, 1, 1, 0]:

# for some reason: after checks no for..

normann = 3

for j in numbers:

compute_field(j, A, phi, i, Vebit, Vebitmax, cavmaxreal, factor, betaS, minimumf, maximumf, diffE, E)

else:

refresh()

def clickrow(Qcont, A1, nameiso, qdivbya, abu2, information, A, diffqa0, check3, check4, factor, \

phi, minimumf, maximumf, cavmaxreal, combo):

Qchosen = float(text1[0])

Number = float(text1[2])

Energy = float(text1[3])

if check4 == 0 and check3 == 1:

listfields = int(Number)*[fieldreal]

for Qchosen, fieldreal, Number, Energy in info_for_click:

... ...

if __name__ == '__main__': main()

Thanks a lot in advance!!

Best, Johann