简体   繁体   中英

Call for a python script from a PBS job

How can I call a python script to run from a pbs job? Some more details: I am currently working with a pbs file of the following shape (this part works perfectly and shouldn't be altered):

#!/bin/bash
#PBS -N # work name 
#PBS -q 
#PBS -l 
#PBS -S /bin/bash
#PBS -m 
##PBS -M #my email 
cd $PBS_O_WORKDIR

I have to modify it so after the calculation above finishes a python script (which works on the output file) will be called. The calculation takes a few minutes to finish so a delay before the calling for the python script has to be specified. I have no knowledge in bash programming so it's a real struggle for me.

You just have to add the lines to call the python script:

#!/bin/bash
#PBS -N # work name 
#PBS -q 
#PBS -l 
#PBS -S /bin/bash
#PBS -m 
##PBS -M #my email 
cd $PBS_O_WORKDIR
python3 my_python_script.py

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM