From e8169286b9c6d643ebf43946525c39a0202ad9ee Mon Sep 17 00:00:00 2001 From: schoener Date: Mon, 7 Feb 2022 19:36:10 +0100 Subject: [PATCH] Export code (added same string lenghth for each number) --- Coil_geometry/Export_field/05_Write_to_txt.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Coil_geometry/Export_field/05_Write_to_txt.py b/Coil_geometry/Export_field/05_Write_to_txt.py index e8660e4..716073c 100644 --- a/Coil_geometry/Export_field/05_Write_to_txt.py +++ b/Coil_geometry/Export_field/05_Write_to_txt.py @@ -46,7 +46,8 @@ def main(): raise ValueError str_line = str_line + str_el + ' ' - bx_txt.writelines(str_line) + str_line += '\n' + bx_txt.write(str_line) bx_txt.close() by_txt = open("output/step_50μm/By_step_50.txt", "w+") @@ -68,8 +69,8 @@ def main(): raise ValueError str_line = str_line + str_el + ' ' - - by_txt.writelines(str_line) + str_line += '\n' + by_txt.write(str_line) by_txt.close() bz_txt = open("output/step_50μm/Bz_step_50.txt", "w+") @@ -90,9 +91,9 @@ def main(): if len(str_el) != 8: raise ValueError - str_line = str_line + str_el + ' ' - - bz_txt.writelines(str_line) + str_line += str_el + ' ' + str_line += '\n' + bz_txt.write(str_line) bz_txt.close() """