Add command line argument to csv printing script

This commit is contained in:
Mario Hüttel 2021-12-27 21:43:47 +01:00
parent fdcc35174f
commit 6be539f738

View File

@ -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)})