From 6be539f7381e5fc4cfd986d5c8292fd54aa78b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Mon, 27 Dec 2021 21:43:47 +0100 Subject: [PATCH] Add command line argument to csv printing script --- print_labels_from_csv.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/print_labels_from_csv.py b/print_labels_from_csv.py index 2284307..51c7e60 100644 --- a/print_labels_from_csv.py +++ b/print_labels_from_csv.py @@ -2,9 +2,14 @@ import pandas as pd import shimatta_label.label_image as li import shimatta_label.brother_ql_wrapper as ql_wrapper import os +import sys medir = os.path.dirname(__file__) -example_data_path = os.path.join(medir, 'labels.csv') + +if len(sys.argv) > 2: + example_data_path = sys.argv[1] +else: + example_data_path = os.path.join(medir, 'labels.csv') df = pd.read_csv(example_data_path, converters={i: str for i in range(3)})