title: Passing R variables to a python script with reticulate
body: <p>I have a python script that I want to run from within R using the reticulate package. I want to assign some variables in R first, and then pass them to the script. Unfortunately when I run the script, I am surprised to see that python can't recognize the variables. What am I missing here? Thanks</p>
  
  <p>Python script (<code>test.py</code>):</p>
  
  <pre><code>print(x)
  </code></pre>
  
  <p>R code:</p>
  
  <pre><code>library(reticulate)
  x &lt;- 5
  source_python(test.py)
  </code></pre>
  
  <p>The error:</p>
  
  <pre><code>Error in py_run_file_impl(file, local, convert) : 
    NameError: name 'x' is not defined
  </code></pre>