Ask Your Question
0

while using python code in psse, psse is not able to recognize other libraries like "xlsxwriter"

asked 2024-02-02 00:22:23 -0600

fawadian gravatar image

I am running a python code in psse which gets data from psse and does some working on it and writes the data to an excel file. The library is xlsxwriter. Even though i have installed this library using pip. Still its does not recognize this library.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2024-02-02 11:16:39 -0600

jconto gravatar image

Check if errors were printed during installation. Check list of modules installed in CMD window with "pip list"

Test import command in python, in CMD window:

c:\..>python
>>import xlsxwriter

No error messages if able to import.

Test a simple code (works in python 3.9):

import xlsxwriter

workbook = xlsxwriter.Workbook('arrays.xlsx')
worksheet = workbook.add_worksheet('test')

array = [['a1', 'a2', 'a3'],
         ['a4', 'a5', 'a6'],
         ['a7', 'a8', 'a9'],
         ['a10', 'a11', 'a12', 'a13', 'a14']]

row = 0

for col, data in enumerate(array):
    worksheet.write_column(row, col, data)

workbook.close()
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

Stats

Asked: 2024-02-02 00:22:23 -0600

Seen: 109 times

Last updated: Feb 02