I want to add a new task to a program made by someone else
The other program is composed of several files that work together, but I only need to modify a file which contains only an array with values that it uses for calculation (file name case30 ) p>
from numpy import matrix
GD = matrix(' 1 0.0 0 0 0 1 ;'
' 2 0.0 0 -0.4 0.5 1 ;'
' 5 0 0 -0.4 0.4 1 ;'
' 8 0 0 -0.1 0.4 1 ;'
' 11 0 0 -0.06 0.24 1 ;'
' 13 0 0 -0.06 0.24 1 ')
subsequently other files use these values to work
my program calculates optimal values and assigns them variables within Calc (the program is very long and I can not put it all), file name window
def Calc():
P_Barra_1 = resultados_m [0]
P_Barra_2 = resultados_m [1]
P_Barra_3 = resultados_m [2]
P_Barra_4 = resultados_m [3]
P_Barra_5 = resultados_m [4]
P_Barra_6 = resultados_m [5]
I want to replace the values in the first column of the matrix with the results of my program
from numpy import matrix
GD = matrix(' 1 0.0 0 0 0 1 ;'
' 2 0.0 0 -0.4 0.5 1 ;'
' 5 0 0 -0.4 0.4 1 ;'
' 8 0 0 -0.1 0.4 1 ;'
' 11 0 0 -0.06 0.24 1 ;'
' 13 0 0 -0.06 0.24 1 ')
GD [0,0]= P_Barra_1
GD [1,0]= P_Barra_2
GD [2,0]= P_Barra_3
GD [3,0]= P_Barra_4
GD [4,0]= P_Barra_5
GD [5,0]= P_Barra_6
I do not know how to make the other file read the variables of my program P_Barra_1,2,3, ...