title: Read/write same variable in batch and python scripts
body: <p>I have 2 scripts. One is .bat and other is python. The python script is triggered by the .bat file. While executing, first I will run .bat with command line arguments but then I need to read the argument into the python script.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>I call the batch script like this:</p>
  
  <pre><code>C:&gt;main.bat c:\temp\text1.txt
  </code></pre>
  
  <p>main.bat : </p>
  
  <pre><code>@ECHO off
  set var1=%~1
  call python_script.bat 
  echo "returned to main"
  pause
  </code></pre>
  
  <p>python_script.bat :</p>
  
  <pre><code>python -x %0 %*
  
  print var1        # Notworking
  
  import sys
  var1 = sys.argv  ############  Also not working
  
  with open(var1, 'r+') as f:
  content = f.read()
  f.seek(0)
  f.trunca........
  </code></pre>