From 53bd62f3a55cde1dce09bdb867dfe0b84d578227 Mon Sep 17 00:00:00 2001 From: Aineopintojen-harjoitustyo-Algoritmit-j Date: Sat, 27 Jan 2024 13:31:17 +0200 Subject: Adding exit codes and batch runner script. --- __main__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to '__main__.py') diff --git a/__main__.py b/__main__.py index edf3888..627f724 100644 --- a/__main__.py +++ b/__main__.py @@ -1,4 +1,5 @@ """ __main__.py - Tästä suoritus alkaa """ +import sys from argparse import ArgumentParser from app import App @@ -35,4 +36,7 @@ parser.add_argument( args = parser.parse_args() app = App(args) -app.run() +is_win = app.run() +del app + +sys.exit(not is_win) # Exit koodeissa 0 on onnistunut suoritus -- cgit v1.2.3