From 64b730241d9418686d1a61f51b0efe717b39b683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20S=C3=B8rensen?= Date: Thu, 23 May 2024 09:24:20 +0200 Subject: [PATCH] print to sys.stderr when not succesful --- examples/enrich_csv_file.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/enrich_csv_file.py b/examples/enrich_csv_file.py index 0a54221..4b8c457 100644 --- a/examples/enrich_csv_file.py +++ b/examples/enrich_csv_file.py @@ -55,15 +55,15 @@ def enrichLines(lines: List[str], apiKey: str): def main(): filename = " ".join(sys.argv[1:]) if len(filename) < 2: - print("Usage: python examples/enrich_csv_file.py ") - print("Example: python examples/enrich_csv_file.py input.csv > output.csv") + print("Usage: python examples/enrich_csv_file.py ", file=sys.stderr) + print("Example: python examples/enrich_csv_file.py input.csv > output.csv", file=sys.stderr) exit(1) if not os.path.isfile(filename): - print(f"File '{filename}' does not exist") + print(f"File '{filename}' does not exist", file=sys.stderr) exit(1) apiKey = os.getenv("DIGISEG_API_KEY") if not apiKey: - print("Please provide a Digiseg API key in environment variable DIGISEG_API_KEY") + print("Please provide a Digiseg API key in environment variable DIGISEG_API_KEY", file=sys.stderr) exit(1) with open(filename, "r") as file: