I have a list like:
[('Name','x','y','z'),('Name2','x2','y2',z2')]
and i have code like:
with open(file_path, "w") as f: f.write("n".join(self.cs2_cords)) f.close()
but when it completed it result:
('Name','x','y','z') ('Name2','x2','y2','z2')
how i can remove brackets and quotes without using replace()
?
I tried to write it with
with open(file_path, "w") as f: for tup in self.cs2_cords: f.write(" ".join(tup) + "n") f.close()
and
`with open(file_path, “w”) as f:
for tup in self.cs2_cords:
f.write(” “.join(map(str,tup)) + “n”)
f.close()“
theese doesn’t help me
Vanyaxxl is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.