First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
import excelpy
ierr, totalload = psspy.systot('LOAD')
P = totalload.real Q = totalload.imag
wb = excelpy.workbook()
wb.setcell('A1', P) wb.setcell('B1', Q)
I'm sure you can elaborate on that basic code.
2 | No.2 Revision |
import excelpy
ierr, totalload = psspy.systot('LOAD')
P = totalload.real Q = totalload.imag
wb = excelpy.workbook()
wb.setcell('A1', P) wb.setcell('B1', Q)
I'm sure you can elaborate on that basic code.
You cannot export complex numbers using this set_cell function, only real numbers. That's why I am exporting P and Q into separate cells. If you try to export a complex number you get this error message.
TypeError: Objects of type 'complex' can not be converted to a COM VARIANT