Passing arguments from one script to another, in a script : <p>I am trying to pass a python script variables from another python script in a python script. What I am trying to do in code form:</p>

<p>file1.py</p>

<pre><code>global x
x = 7
</code></pre>

<p>file2.py</p>

<pre><code>print x
</code></pre>

<p>file3.py</p>

<pre><code>import file1
import file2
</code></pre>

<p>But I always get the error x is not defined. If I import file1 in file2 and run it, it works, but if I run file2 from file3 it does not work.</p>

<p>Help would be much appreciated :)</p>
