pretty printing

This commit is contained in:
Maximilian Schlosser 2017-07-12 18:17:05 +02:00
parent a719dd974c
commit 3ccbed4d3a
2 changed files with 8 additions and 7 deletions

View file

@ -1,4 +1,4 @@
import matplotlib.pyplot as plt
from matplotlib import pyplot as plt
from matplotlib import colors
from matplotlib import patches
import numpy as np

View file

@ -3,14 +3,13 @@
import sys
import getopt
from SchedulingAlgorithms import simanneal as sim
from Outpout import output as o
def usage():
s= """
Command line options:
-h show this help
-p activate pretty output (matplotlib)
-p activate pretty output (requires tkinter)
-l assume that a file contains multiple problems, default is only 1
-i index of the problem you want solved. has no effect without l
@ -32,6 +31,7 @@ def main():
print(usage())
if ('-p', '') in opts:
print("Plotting enabled.")
from Output import output as o
plot = True
if('-l', '') in opts:
js1 = True
@ -48,8 +48,9 @@ def main():
from Parser import js2_style as parser
print("Parsing file: " + infile)
problem = parser.parse_file(infile)
if js1 and idx == -1:
if js1:
print("File contains " + str(len(problem)) + " problems.")
if idx == -1:
idx = int(input("Which problem do you want so solve? [0-" + str(len(problem)-1) + "] "))
problem = problem[idx]
print(problem)