title: Lock current working directory in subprocess? or make cwd as home directory
body: <p>simply I am using windows 10 operating system and run code in python as</p>
  <h3>main.py</h3>
  <pre class="lang-py prettyprint-override"><code>cmd = &quot;python example.py&quot;
  sp = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, cwd=&quot;/home&quot;, env=new_env)
  </code></pre>
  <p>so cwd is now <code>C:/home</code> but using <code>os.chdir()</code> I am able to change directory to <code>D:</code> or like <code>C:/User/Desktop</code> etc, externally using <code>example.py</code>.</p>
  <p>Now, I would like to lock the directory to <code>/home</code> so, if any code run through <code>example.py</code> then the main directory for the code run in <code>example.py</code> will be <code>/home</code> and the directory is not be able to change from <code>/home</code> any other directory.</p>