I am running a program which uses subprocess.Popen() in order to do some tasks (I cannot use os.system() for them). The program, which correctly runs within an IDE (I will explain later) stops when I run it from the console, although I can resume it by writing fg in the console.
The code is the following (this is a piece of code,the full code implements similar tasks to which the same problem occurs)...
import subprocess
p,o = subprocess.Popen(['/bin/bash', '-c', '-i', 'which python3.5'], stdout=subprocess.PIPE).communicate()
p = p.decode('ascii')
print(p)
print('Installing pysamstats...')
subprocess.Popen(['/bin/bash', '-c', '-i', 'conda install -y -c bioconda pysamstats']).communicate()
print('OK')
If the code is run from an I