From 80a412f31c18a2fdf1d56cf9ec817a1d1819de82 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 12 Aug 2025 15:20:16 +0200 Subject: Small improvemen to python example --- python/examples/solve.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/python/examples/solve.py b/python/examples/solve.py index d77dd74..725c704 100644 --- a/python/examples/solve.py +++ b/python/examples/solve.py @@ -14,11 +14,13 @@ import nissy # Choose the solver you prefer solver = "h48h0k4" -# Load the pruning table from file -data = bytearray(open("tables/" + solver, "rb").read()) - -# If you have not generated the table yet, you can do so: -# data = nissy.gendata("h48h0k4") +# Load the pruning table from file, generate it if needed +datapath = "tables" + os.path.sep + solver +if os.path.exists(datapath): + data = bytearray(open(datapath, "rb").read()) +else: + data = nissy.gendata("h48h0k4") + print("Generated data will NOT be persisted") # Get a scrambled cube cube = nissy.applymoves(nissy.solved_cube, "U F R2"); -- cgit v1.3