Python, get the name of the variable in an array, to be used as part of another statement : Im fairly new with Python, and I was creating a new script in which I generate an array that contains a list of strings(g='g_o.DisplacementMultiplier_'+str(y+1), where y varies from 0 to 400).
This later has to be used to set four properties in a third party software, but I see that the syntax im using set the properties for the variable g and not for g_o.DisplacementMultiplier_#)

Attached is the code

thank you.

    import smtplib
    import math
    import time
    import imp
    import numpy as np
    s_o,g_o=new_server
    s_o.new()
    
    # Geometry
    Bench = 5 # Crest bench
    Angle = 23
    Height = 15.3
    
    # Frequencies
    fz=[]
    Tmin=0.01
    Tmax=4
    Tstep=0.01
    Ts = np.arange(Tmin, (Tmax+Tstep), Tstep)
    fz = float(1)/Ts
        
    # Calculate x-lenght of slope
    dtot= Height / math.tan(math.pi*Angle/180)
    
    # Calculate xmax
    xmax = (2 * dtot)+ Bench
      
    # Displacement
    g_o.linedispl (0, 0, xmax, 0)
    g_o.set(g_o.Line_1.LineDisplacement.Displacement_x, "Prescribed")
    g_o.set(g_o.Line_1.LineDisplacement.Displacement_y, "Fixed")
    g_o.set(g_o.Line_1.LineDisplacement.ux_start, 1)
    
    # Generate displc multipliers
    for y in range (0, len(fz)):
        g_o.displmultiplier()
        g='g_o.DisplacementMultiplier_'+str(y+1)
        g_o.set(g[y].Amplitude, 10)
        g_o.set(g[y].DataType, "Accelerations")
        g_o.set(g[y].Frequency, fz[y])
           
    
The error id get form that code is     g_o.set(g[y].Amplitude, 10)
AttributeError: 'str' object has no attribute 'Amplitude'  
        












