Reputation: 53
I use Python scripts to prepare some stuff for long quantum calculations. So, when I run target binary from terminal
targetbin file.inp > file.out
I can see that process is still running. With Python I do some automations:
#!/usr/bin/env python3
# blah blah blah
cmd = ' '.join([targetbin, modified_inp_file, some_options, '>', created_out_file])
# /usr/bin/targetbin /tmp/XXX.inp -a 1 -b 2 -c 3 > file.out
subprocess.Popen(cmd, shell=True)
run it from terminal:
pythonscript -x 1 -y 2 -z 3 file.inp
and it works fine, but it doesn't hold shell. After Python initiate the process I want to delegate it completely to the shell and then exit Python itself, as if I entered cmd
myself. Is it possible?
Upvotes: 2
Views: 139
Reputation: 4706
You can try this way -
fg
. (Alternatively, you can get the PID
from python and run kill -CONT <pid>
).Upvotes: 1