- Python script that takes a JSON with a list and a JSON with the last result; it will choose an item from the list, avoiding the last result.
python3 randomize.py-
- Run the command above to create initial JSON files;
-
- Edit
listToRandomize.jsonwith the result description and the data you need to randomize;
- Edit
-
- Run the command above again and the result will be printed to the screen.
python3 randomize.py --loop 3- The
--loop nflag allows the program to be executedntimes (nmust be an integer).
python3 randomize.py --no-repeat- Running the program with the flag
--no-repeatwill make it avoid all items that were already selected until the whole list is over; - This option will also generate a nice log of the program execution in the file
alreadyRandomized.json, thus generating an automatic report of an activity or process that needs random sorting to function.
- Scripts
save_result_as_JSON.shandsave_result_as_MD.shread data from the session JSON files and save it to the corresponding file format, allowing the session data to backed up.
chmod +x save_result_as_{JSON,MD}.sh- First add execution permission to the scripts.
./save_result_as_JSON.sh 'file_name'
- If
jqis installed the result will be printed to the screen; - Install it on
Debiansystems with
sudo apt install -y jq./save_result_as_MD.sh 'file_name'