我有一个python脚本,我想用gnu-parallel这样调用它:
parallel run_script.py --outfile=/path/to/somewhere/{}/{}.nc --shift={} ::: 1 2 3如何转义用于python字符串格式化的--outfile中的第一个花括号?
预期结果:
parallel --dry-run run_script.py --outfile=/path/to/somewhere/{}/{}.nc --shift={} ::: 1 2 3
run_script.py --outfile=/path/to/somewhere/{}/{}.nc --shift=1
run_script.py --outfile=/path/to/somewhere/{}/{}.nc --shift=2
run_script.py --outfile=/path/to/somewhere/{}/{}.nc --shift=3发布于 2017-03-02 15:58:27
使用-I将{}更改为其他内容:
parallel -I ,, --dry-run run_script.py --outfile=/path/to/somewhere/{}/{}.nc --shift=,, ::: 1 2 3https://stackoverflow.com/questions/42532693
复制相似问题