I have a list and want to write it into a file without '' , []
d = [['value1', 'value2', 'value3', 'value4', 'LatX', 'LonY', 'HgtZ', 'sats'],
['431.84', '1417', '3.63', '10.28', '47.06446389', '15.45043694', '428.08', '6'],
['438.25', '1416', '3.63', '10.28', '47.06446583', '15.45044000', '428.00', '6'],
['437.64', '1418', '3.63', '9.7', '47.06446583', '15.45044333', '428.03', '6']]
And the file it should look like this:
value1 value2 value3 value4 LatX LonY HgtZ sats
1415 1417 119 337 47.06446389 15.45043694 428.08 6
1436 1416 119 337 47.06446583 15.45044000 428.00 6
1434 1418 119 318 47.06446583 15.45044333 428.03 6
my code (Python 3.7):
with open('your_file.txt', 'w') as f:
for item in d:
f.write("%s\n" % str(item))
this function print the lists in d, line by line