Skip to content
Advertisement

Parse screeninfo into useable csv

I am tryin to parse a string from screeninfo to be useable in a csv file. here is my code

JavaScript

here is the output:

JavaScript

This results in a one cell csv because it imports the whole string.

I am trying to parse it so that I can call x, y , width, height and display as individual cells.

so it would look similar to

monitor, x=0, y=0, x1=0, y1=0, displayname,

please and thank you.

Advertisement

Answer

I don’t understand why you convert to string str(m) and try to parse it

You can get every value directly m.x, my.x, m.width, m.height, m.name

JavaScript

and if you want with x=, y= then you can format line as string and write without csvwriter

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement