title: Python copying variable file from a variable directory using shell or not
body: <p>I have the following python code which tries to copy a file stored in a variable <code>file</code> from a variable directory <code>dir</code>. I also attempting get those variables passed as shell variables, then I can copy using shell command as well.</p>
  
  <p>Is any/both of these possible? Then please amend my code.</p>
  
  <pre><code>import os
  import shutil
  import subprocess
  
  
  dir='somedir'
  file='somefile'
  
  # Now I want to get $dir as a shell variable and copy the file to
  #   my present directory
  
  os.system("echo $dir")
  os.system("cp $dir/$file .")
  
  # I want to copy dir/file to the present directory
  
  shutil.copy(dir/file,file) # Following shutil.copy(src,dest) format
  shutil.copyfile(dir/file,file)
  </code></pre>
  
  <p>The </p>