title: Execute python scripts from another python script opening another shell
body: <p>I'm using python 3, I need one script to call the other and run it in a different shell, without passing arguments, I'm using mac os x, but I need it to be cross platform.</p>
  
  <p>I tried with</p>
  
  <pre><code>    os.system('script2.py')  
      subprocess.Popen('script2.py',     shell=true)
      os.execl(sys.executable, "python3", 'script2.py')
  </code></pre>
  
  <p>But none of them accomplish what I need.</p>
  
  <p>I use the second script to get inputs, while the first one handles the outputs...</p>
  
  <p>EDIT</p>
  
  <p>This is the code on my second script:</p>
  
  <pre><code>import sys
  import os
  import datetime
  
  os.remove('Logs/consoleLog.txt')
  try:
      os.remove('Temp/commands.txt')
  except:
      ...
  
  stopSim = False
  
  command = ''
  
  okFile = open('ok.txt', 'w')
  okFile.write('True')
  consoleLog = open('Logs/consoleLog.txt', 'w')
  
  okFile.close()
  
  while not stopSim:
  
      try:
          sysTime = datetime.datetime.now()
          stringT = str(sysTime)
          split1 = stringT.split(" ")
          split2 = split1[0].split("-")
          split3 = split1[1].split(":")
  
          for i in range(3):
              split2.append(split3[i])
  
          timeString = "{0}-{1}-{2} {3}:{4}".format(split2[2], split2[1],   split2[0], split2[3], split2[4])
      except:
          timestring = "Time"
  
      commandFile = open('Temp/commands.txt', 'w')
  
      command = input(timeString + ": ")
      command = command.lower()
  
      consoleLog.write(timeString + ': ' + command + "\n")
      commandFile.write(command)
  
      commandFile.close()
      if command == 'stop simulation' or command == 'stop sim':
          stopSim = True
  
  consoleLog.close()
  os.remove('Temp/commands.txt')
  </code></pre>
  
  <p>and this is where I call and what for the other script to be operative in script 1:</p>
  
  <pre><code>#Open console
  
  while not consoleOpent:
      try:
          okFile = open('ok.txt', 'r')
          c = okFile.read()
          if c == 'True':
              consoleOpent = True
      except:
          ...
  </code></pre>
  
  <p>Sorry for the long question...
  Any suggestion to improve the code is welcomed.</p>