July 2018
Beginner to intermediate
406 pages
9h 55m
English
Tasks are the basic building blocks of jug. A task is composed of a function and values for its arguments. Consider this simple example:
def double(x):
return 2*x
In this chapter, the code examples will generally have to be typed in script files. Commands that should be typed at the shell will be indicated by prefixing them with $.
A task could be call double with argument 3. Another task would be call double with argument 642.34. Using jug, we can build these tasks as follows:
from jug import Task t1 = Task(double, 3) t2 = Task(double, 642.34)
Save this to a file called jugfile.py (which is just a regular Python file). Now, we can run jug execute to run the tasks. This is something you type on the command ...
Read now
Unlock full access