aboutsummaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'app.py')
-rw-r--r--app.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/app.py b/app.py
index f8078c1..bbe6252 100644
--- a/app.py
+++ b/app.py
@@ -48,8 +48,10 @@ def generate_matrix_from_edges(edges_file_path, matrix_file_path):
48 48
49 # Write matrix to file 49 # Write matrix to file
50 with open(matrix_file_path, "w") as f: 50 with open(matrix_file_path, "w") as f:
51 for row in matrix: 51 for idx, row in enumerate(matrix):
52 f.write(" ".join(map(str, row)) + "\n") 52 if idx > 0:
53 f.write("\n")
54 f.write(" ".join(map(str, row)))
53 55
54 except Exception as e: 56 except Exception as e:
55 print(f"Error generating matrix: {e}") 57 print(f"Error generating matrix: {e}")