From 200b1b630e891de7f522b83abbccf4eb85c75811 Mon Sep 17 00:00:00 2001 From: James Baster Date: Sat, 28 Jul 2018 10:21:53 +0100 Subject: [PATCH] Add to tutorial - add sleep to code so people can see the status changes --- docs/tutorial/1-init.rst | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/tutorial/1-init.rst b/docs/tutorial/1-init.rst index 93e02a7..2d10893 100644 --- a/docs/tutorial/1-init.rst +++ b/docs/tutorial/1-init.rst @@ -242,6 +242,37 @@ The console output contains two things. a call, but the execution will move to the next row. +However, if you run the tutorial.py it happens too fast and you can't see the status change. Let's add some delays to your code. + +At the top of tutorial.py add a new import and add some delays to the 3 stages: + +.. code-block:: python + + import time + + def extract(): + """Placeholder, change, rename, remove... """ + time.sleep(5) + yield 'hello' + time.sleep(5) + yield 'world' + + + def transform(*args): + """Placeholder, change, rename, remove... """ + time.sleep(5) + yield tuple( + map(str.title, args) + ) + + + def load(*args): + """Placeholder, change, rename, remove... """ + time.sleep(5) + print(*args) + +Now run tutorial.py again, and you can see the status change during the process. + Wrap up :::::::