Ask Your Question
0

variable error and storing variable into single quote ' '

asked 2017-08-15 18:41:25 -0500

Mike gravatar image

below is a portion of code where data is read from an excel file and is transferred into a psspy function. I am receiving an error about _i and _f not being variables. But I received this code by running an ibdev on PSSE. Is there any way to change this so the error is eliminated. I tried using the API's default variables but it didn't work as well. Also for the third element in the array, I'm trying to put a variable into a string so it can loop through multiple characters in my excel sheet. Is that the correct way of doing it? Attached are the API's for this particular function and capability.API 1API 2API 3

    for row in data:
    data_location, year_link, from_, to, max_value, min_value,digit = row[5:12]
    output = 'From Bus #: {}\tTo Bus #: {}\tVMAX: {} pu\tVMIN: {} pu\t'
      if year_link == year and data_location == location:
         print(output.format(from_, to, max_value, min_value))

   psspy.two_winding_chng_4(from_,to,'%s'%digit,[_i,_i,_i,_i,_i,_i,_i,_i,_i,_i,_i,_i,_i,_i,_i]
   [_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f, max_value, min_value,_f,_f,_f],[])
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-08-16 05:27:10 -0500

perolofl gravatar image

Add the following at the beginning of your code:

_i=psspy.getdefaultint()
_f=psspy.getdefaultreal()
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2017-08-15 18:41:25 -0500

Seen: 339 times

Last updated: Aug 16 '17