to store thelist of coordinates columnwise in csv files

150 Views Asked by At

I have a list of coordinates and I want to store them in columns The list is like and they are created according to the loop so they keep on changing when the loop enters the next image.

CC = [ (113,254),(163,253),(230,252),......]
CC = [ (0,2128),(163,253),(229,252),......]

I used the below code to create the csv file and store it

with open( "XY.csv", "a") as out_file:
                out_string = ""
                out_string += str(simg_name)
                out_string +=  "," + ",".join([str(i) for i in CC])
                out_string += "\n"
                out_file.write(out_string)

But it stores like enter image description here

I want it to be and remove the "(" ")" also

enter image description here

0

There are 0 best solutions below