title: run python script in the background
body: <p>I wrote a Python script to run several NS-3 simulations with different seeds and different node counts.
  My script calls <code>./waf --run=&lt;scenario_name&gt;</code> then executes 10 seeds, change node count and execute 10 more seeds, and so on.</p>
  
  <p>The problem is that after I call my script, I ask the user for an input (which scenario to run). Because of that <code>raw_input</code> call, I couldn't use <code>nohup myScript.py &amp;</code>. I also tried <code>CTRL + Z</code>, <code>bg</code>, and <code>disown</code>. But that didn't work either.</p>
  
  <p>Here's my script:</p>
  
  <pre><code>#!/usr/bin/python
  
  import subprocess
  from pathlib import Path
  import glob
  
  scenario = raw_input("Type scenario (foo or bar): ")
  if scenario == 'foo':
      wafString = './waf --run "scratch/test-foo --nodeCount='
  
  elif scenario == 'bar':
      wafString = './waf --run "scratch/test-bar --nodeCount='
  
  else:
      print ("Wrong input!")
  
  ns3Global = 'NS_GLOBAL_VALUE="RngRun='    
  numbers = [25, 50, 100] # number of nodes
  
  for nodeCount in numbers:
     for rngRun in range(1,11):
         myArgument =  ns3Global + str(rngRun) + '" ' + wafString + str(nodeCount) + '" '
  
         print "*** Running experiment with " + str(nodeCount) + \
               " nodes and random seed " + str(rngRun) + "\n"
         subprocess.call(myArgument, shell=True)
  </code></pre>
  
  <p>Any help will be much appreciated.</p>