I can get the value nwhen I run the shell command using os.systemin a python script, but I also need to sum it to get the total number for subsequent calculations in a python script,
total=0
for i in xrange(1,8):
os.system('n=$(qstat -n1 | grep -o node'+str(i)+' | wc -l) && echo $n')
Is it possible? It is also possible to use a python variable in a shell command, something like
os.system('echo $total')
source
share