title: Python error when using an object from a script in a function imported from another script
body: <p>In a file <code>a.py</code> I have the following code:</p>
  <pre><code># a.py
  
  def test():
      global i
      print(f'The number is {i}')
  </code></pre>
  <p>So, in a file <code>b.py</code> I imported <code>a.py</code>:</p>
  <pre><code># b.py
  
  from a import *
  
  i = 22
  
  test()
  </code></pre>
  <p>When I run this code I get the following error:</p>
  <pre><code>NameError: name 'i' is not defined
  </code></pre>
  <p>I thought this would work, once the function was imported, and, object i was defined in b.py. How do I resolve this?</p>