Mercurial > hg > webaudioevaluationtool
diff scripts/score_parser.py @ 1063:e67a76e9ba7a
Scripts: choose input/output folder from command line; score_plot also choose options from command line (WIP)
author | Brecht De Man <BrechtDeMan@users.noreply.github.com> |
---|---|
date | Mon, 20 Jul 2015 12:47:16 +0100 |
parents | b7fd0296c6ab |
children | 99cb3436759e |
line wrap: on
line diff
--- a/scripts/score_parser.py Wed Jul 15 15:52:56 2015 +0100 +++ b/scripts/score_parser.py Mon Jul 20 12:47:16 2015 +0100 @@ -2,12 +2,23 @@ import xml.etree.ElementTree as ET import os +import sys import csv #TODO Remove DEBUG statements -# XML results files location (modify as needed): -folder_name = "../saves" # Looks in 'saves/' folder from 'scripts/' folder +# COMMAND LINE ARGUMENTS + +assert len(sys.argv)<3, "score_parser takes at most 1 command line argument\n"+\ + "Use: python score_parser.py [rating_folder_location]" + +# XML results files location +if len(sys.argv) == 1: + folder_name = "../saves" # Looks in 'saves/' folder from 'scripts/' folder + print "Use: python score_parser.py [rating_folder_location]" + print "Using default path: " + folder_name +elif len(sys.argv) == 2: + folder_name = sys.argv[1] # First command line argument is folder # get every XML file in folder for file in os.listdir(folder_name):