在将python浮点数写入文件时,请使用科学记数法

Zac*_*ach 2 python floating-point notation

将浮点数写入CSV会像下面这样写入其中一些:2.0628800997782577e-05

c = csv.writer(open(file, "wb"))
c.writerow([var1, var2])    
Run Code Online (Sandbox Code Playgroud)

我尝试过的:

  • 我已经在StackOverflow上的其他答案之后尝试了var1**8,但这只是将它们提升到了8的幂.
  • 我也尝试过Decimal(var1),但这并不能抑制科学记数法.

这使得以后很难处理excel中的输出,因为它被识别为文本而不是数字.如何以非科学的十进制表示法打印?