Skip to content

Commit

Permalink
use f-strings in example pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
nsheff committed Feb 17, 2024
1 parent 87f1074 commit 65ed31d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions example_pipelines/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
tgt = "pipeline_output/test.out"

# build the command
cmd = "shuf -i 1-500000000 -n 10000000 > " + tgt
cmd = f"shuf -i 1-500000000 -n 10000000 > {tgt}"

# and run with run().
pm.run(cmd, target=tgt)

# Now copy the data into a new file.
# first specify target file and build command:
tgt = "pipeline_output/copied.out"
cmd = "cp pipeline_output/test.out " + tgt
cmd = f"cp pipeline_output/test.out {tgt}"
pm.run(cmd, target=tgt)

# You can also string multiple commands together, which will execute
Expand Down
2 changes: 1 addition & 1 deletion example_pipelines/hello_pypiper.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# Now build a command-line command however you like, and pass it to pm.run()
target_file = "hello_pypiper_results/output.txt"
cmd = "echo 'Hello, Pypiper!' > " + target_file
cmd = f"echo 'Hello, Pypiper!' > {target_file}"
pm.run(cmd, target_file)

pm.stop_pipeline()

0 comments on commit 65ed31d

Please sign in to comment.