title: How to send values of variables stored in a function to another Python file?
body: <p>I'm trying to create a program to play Tic-Tac-Toe. Now I need the "console.py" to send the coordinates of the mouse to the "core.py" when the mouse button is clicked. Here is the code:-</p>
  
  <p>console.py</p>
  
  <pre><code>import turtle
  import core
  import graphics
  
  
  def findPos(eve):
      x, y = canvas.winfo_pointerxy()
      print(x, y)
      return x, y
  
  canvas = turtle.getcanvas()
  canvas.bind('&lt;Button-1&gt;', findPos)
  </code></pre>
  
  <p>core.py</p>
  
  <pre><code>import numpy as np
  import turtle
  import console as tc
  
  print(tc.x, tc.y)
  </code></pre>
  
  <p>Now,an error is thrown:</p>
  
  <p><code>AttributeError: module 'console' has no attribute 'x'</code></p>
  
  <p>How do I fix this?</p>