使用python编程实现将列表中的元素导出为excel文件

orgin_list = [[13378434.0829, 3526829.86612], [13378960.4042, 3526855.13451], [13372997.8308, 3526543.79201],
              [13382041.2247, 3527903.34268],
              [13380083.2029, 3528692.35517], [13380962.0043, 3528519.81002], [13379799.8328, 3528740.27736],
              [13380743.9947, 3528862.75402],
              [13380888.449, 3529724.53706], [13381768.4638, 3530180.20618], [13380283.8783, 3530417.55057],
              [13379460.7078, 3529092.52867],
              [13375514.1202, 3528071.73721], [13380595.5945, 3530292.25917], [13380750.4876, 3529651.32254],
              [13380020.662, 3530023.70025],
              [13382992.3395, 3529466.83067], [13380185.5946, 3529943.15481], [13381854.6163, 3529846.18257],
              [13381526.4017, 3530218.27078],
              [13379174.5312, 3529960.69999], [13381059.6294, 3528718.48633], [13382355.3521, 3529153.06305],
              [13378953.0301, 3529940.64725],
              [13380888.4348, 3529724.14486], [13380819.3038, 3529686.64969], [13380804.0029, 3529637.84483],
              [13380384.6579, 3530019.02258],
              [13380889.7788, 3528822.12922], [13380021.021, 3530023.8262], [13381334.9882, 3529485.57797],
              [13380021.3358, 3530024.2176],
              [13380579.4085, 3528966.76369], [13378335.8706, 3525730.70208], [13376163.5724, 3525339.97552],
              [13375946.0184, 3525204.04021],
              [13375692.5073, 3524934.75788], [13375459.9276, 3524858.85187], [13375692.8279, 3524935.01084],
              [13375962.6636, 3525280.13676],
              [13375098.616, 3525046.17908], [13374703.9664, 3525093.6227], [13377167.3635, 3524698.59287],
              [13375979.4896, 3525089.74079],
              [13374644.2409, 3524926.12145], [13373473.8382, 3525382.09262], [13376064.0747, 3525358.18945],
              [13376073.4363, 3524763.65672],
              [13376067.8257, 3524653.68303], [13376785.7169, 3525281.54726], [13374648.6243, 3523594.54953],
              [13374505.6438, 3524385.68232],
              [13374704.6372, 3525093.75937], [13375979.3623, 3525089.48732], [13373386.2021, 3525459.09954],
              [13376068.2445, 3524653.68192],
              [13378256.4344, 3527892.07034], [13374516.8695, 3527797.75433], [13373268.7718, 3525794.99404],
              [13374733.503, 3527630.0296]
              ]
result = open('data.xls', 'w', encoding='gbk')
result.write('X\tY\n')
for m in range(len(orgin_list)):
    for n in range(len(orgin_list[m])):
        result.write(str(orgin_list[m][n]))
        result.write('\t')
    result.write('\n')
result.close()

运行结果:

使用python编程实现将列表中的元素导出为excel文件_第1张图片

你可能感兴趣的:(Python学习)