title: Running Python script from .BAT file, taking .BAT Filename as input
body: <p>I got a Python script (test1.py) I need to run with a bat file (render.bat).</p>
  
  <p>Question 1:</p>
  
  <p>First, I had a definition in my test1.py and it always failed to run, nothing happened. Can someone kindly explain why?</p>
  
  <pre><code>import os
  def test01 :
     os.system('explorer')
  </code></pre>
  
  <p>and in the bat file:</p>
  
  <pre><code>python c:/test01.py
  </code></pre>
  
  <p>but as soon as I removed the def it worked. I just want to learn why this happened.</p>
  
  <p>Question 2:</p>
  
  <p>How can I take "render" string from render.bat as a string input for my python script so I can run something like :</p>
  
  <pre><code>import os
  def test1(input) :
     os.system("explorer " + input) 
  </code></pre>
  
  <p>So the "input" is taken from the .BAT filename?</p>