diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml
index e563ce38be1f6aabdb1c7da03ea468a3f1e5291c..f2400fab878870dbe4137a127d63e879c9a90e2f 100644
--- a/.github/workflows/basic.yml
+++ b/.github/workflows/basic.yml
@@ -161,28 +161,10 @@ jobs:
         run:  mpirun -n 4 -oversubscribe build/bin/unit-mpi
       - if:   ${{ matrix.config.mpi == 'OFF' }}
         name: Run examples
-        run: |
-            build/bin/bench
-            build/bin/brunel
-            build/bin/dryrun
-            build/bin/gap_junctions
-            build/bin/generators
-            build/bin/lfp
-            build/bin/probe-demo v
-            build/bin/ring
-            build/bin/single-cell
+        run: scripts/run_cpp_examples.sh
       - if:   ${{ matrix.config.mpi == 'ON' }}
         name: Run examples with MPI
-        run: |
-            mpirun -n 4 -oversubscribe build/bin/bench
-            mpirun -n 4 -oversubscribe build/bin/brunel
-            mpirun -n 4 -oversubscribe build/bin/dryrun
-            mpirun -n 4 -oversubscribe build/bin/gap_junctions
-            mpirun -n 4 -oversubscribe build/bin/generators
-            mpirun -n 4 -oversubscribe build/bin/lfp
-            mpirun -n 4 -oversubscribe build/bin/probe-demo v
-            mpirun -n 4 -oversubscribe build/bin/ring
-            mpirun -n 4 -oversubscribe build/bin/single-cell
+        run: scripts/run_cpp_examples.sh "mpirun -n 4 -oversubscribe"
       - name: Run python tests
         run: |
           cd build
@@ -192,13 +174,4 @@ jobs:
         name: Run python+MPI tests
         run:  mpirun -n 4 -oversubscribe python python/test/unit_distributed/runner.py -v2
       - name: Run Python examples
-        run: |
-            python python/example/network_ring.py
-            python python/example/single_cell_model.py
-            python python/example/single_cell_recipe.py
-            python python/example/single_cell_stdp.py
-            python python/example/brunel.py -n 400 -m 100 -e 20 -p 0.1 -w 1.2 -d 1 -g 0.5 -l 5 -t 100 -s 1 -G 50 -S 123
-            python python/example/single_cell_swc.py python/example/single_cell_detailed.swc
-            python python/example/single_cell_detailed.py python/example/single_cell_detailed.swc
-            python python/example/single_cell_detailed_recipe.py python/example/single_cell_detailed.swc
-            python python/example/single_cell_cable.py
+        run: scripts/run_python_examples.sh
diff --git a/.github/workflows/sanitize.yml b/.github/workflows/sanitize.yml
index 1b40b7f0c20d9dabe20772c6623edeed3fc7410f..1e7e371a56f9a85dab837985800b4ebcf6a584dd 100644
--- a/.github/workflows/sanitize.yml
+++ b/.github/workflows/sanitize.yml
@@ -40,13 +40,4 @@ jobs:
           build/bin/unit --gtest_filter=-*DeathTest
           build/bin/unit-modcc
       - name: Run examples
-        run: |
-          build/bin/bench
-          build/bin/brunel
-          build/bin/dryrun
-          build/bin/gap_junctions
-          build/bin/generators
-          build/bin/lfp
-          build/bin/probe-demo v
-          build/bin/ring
-          build/bin/single-cell
+        run: scripts/run_cpp_examples.sh
diff --git a/scripts/run_cpp_examples.sh b/scripts/run_cpp_examples.sh
new file mode 100755
index 0000000000000000000000000000000000000000..d463b29f3b3cf4b02edf7cb0144e765e4b62cc62
--- /dev/null
+++ b/scripts/run_cpp_examples.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+# Runs all C++ examples
+
+set -Eeuo pipefail
+
+if [[ "$#" -gt 1 ]]; then
+    echo "usage: run_cpp_examples.sh <prefix, e.g., mpirun -n 4 -oversubscribe>"
+	exit 1
+fi
+
+PREFIX=${1:-}
+
+$PREFIX build/bin/bench
+$PREFIX build/bin/brunel
+$PREFIX build/bin/dryrun
+$PREFIX build/bin/gap_junctions
+$PREFIX build/bin/generators
+$PREFIX build/bin/lfp
+$PREFIX build/bin/probe-demo v
+$PREFIX build/bin/ring
+$PREFIX build/bin/single-cell
diff --git a/scripts/run_python_examples.sh b/scripts/run_python_examples.sh
new file mode 100755
index 0000000000000000000000000000000000000000..5eca21dc5f5cdbf98462616bbd88a2b25e121d54
--- /dev/null
+++ b/scripts/run_python_examples.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+# Runs all Python examples
+
+set -Eeuo pipefail
+
+if [[ "$#" -gt 1 ]]; then
+    echo "usage: run_python_examples.sh <prefix>"
+	exit 1
+fi
+
+PREFIX=${1:-}
+
+$PREFIX python python/example/network_ring.py
+$PREFIX python python/example/single_cell_model.py
+$PREFIX python python/example/single_cell_recipe.py
+$PREFIX python python/example/single_cell_stdp.py
+$PREFIX python python/example/brunel.py -n 400 -m 100 -e 20 -p 0.1 -w 1.2 -d 1 -g 0.5 -l 5 -t 100 -s 1 -G 50 -S 123
+$PREFIX python python/example/single_cell_swc.py python/example/single_cell_detailed.swc
+$PREFIX python python/example/single_cell_detailed.py python/example/single_cell_detailed.swc
+$PREFIX python python/example/single_cell_detailed_recipe.py python/example/single_cell_detailed.swc
+$PREFIX python python/example/single_cell_cable.py