Skip to content

Commit 969361e

Browse files
add newline to last line of portfolio_to_csv output (#158)
* add newline to last line of portfolio_to_csv output * Update pytr/portfolio.py * ruff format --------- Co-authored-by: Niklas Rosenstein <[email protected]>
1 parent 0ceb409 commit 969361e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytr/portfolio.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def portfolio_to_csv(self, output_path):
8989

9090
with open(output_path, "w", encoding="utf-8") as f:
9191
f.write("Name;ISIN;quantity;avgCost;netValue\n")
92-
f.write("\n".join(csv_lines))
92+
f.write("\n".join(csv_lines) + ("\n" if csv_lines else ""))
9393

9494
print(f"Wrote {len(csv_lines) + 1} lines to {output_path}")
9595

0 commit comments

Comments
 (0)