DiffyBron
12/09/2019, 5:18 AMfrom prefect import Flow, task
from prefect.tasks.shell import ShellTask
my_task = ShellTask(helper_script="cd /etc")
@task
def print_output(output):
print(output)
with Flow("My shell") as flow:
result = my_task(command='ls -lat')
print_output(result)
if __name__ == '__main__':
out = flow.run()
Chris White
12/09/2019, 5:20 AMDiffyBron
12/09/2019, 5:50 AM