数字书写后CSV输出看起来怪怪[关闭]

问题描述 投票:-4回答:1

我尝试写一些代码,号码是使用Python的常规格式的csv文件,但事情是输出变得如此怪异喜欢当书写时下面的图片。

enter image description here

是不是有什么办法可以让代码号在它的常规形式,如137061032000137068512000133421032000代替1.37061E+111.37069E+111.33421E+11

我目前的尝试:

import csv

number_one = "137061032000"
number_two = "137068512000"
number_three = "133421032000"

with open('outputfile.csv', 'w', newline='') as f:
    writer = csv.writer(f)
    writer.writerow([number_one,number_two,number_three]) 

编辑:如果我扩大每个单元,输出仍然是相同的。

enter image description here

python python-3.x csv numbers
1个回答
1
投票

这是不相关到Python。这是关系到你如何在电子表格软件中使用选择显示数据。尝试增加列的宽度,并验证单元格格式设置

[

后手动改变列的宽度:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.