title: Is it possible to connect attributes from one class to be used in another in python?
body: <p>I'm beginner in python and I've been coding for month now. I decided to make a simple game project (in pygame) where player(circle) would be moving in towards mouse cursor using vectors.</p>
  <pre><code>import pygame
  import random
  import pyautogui 
  #Add Mouse class and use pyautogui.position() to return mouse position later on
  
  pygame.init()
  
  screen_width, screen_height = 500, 500
  screen = pygame.display.set_mode((screen_width, screen_height))
  
  class Player:
      def __init__(self, x, y, circle_color, circle_radius, circle_outline_width):
          self.circle_color = circle_color
          self.coordinates = (x, y)
          self.circle_radius = circle_radius
          self.circle_outline_widht = circle_outline_width
  
      def draw(self, window):
          pygame.draw.circle(window, self.circle_color, self.coordinates, self.circle_radius)
  </code></pre>
  <p>My player class with basic attributes needed to make a player ^^^^</p>
  <pre><code>class Point:
      def __init__(self, x, y):
          self.x = x
          self.y = y
  
      def get_circle_position(self):
          event = pygame.event.poll()
          if event.type == pygame.MOUSEMOTION:
              circle_position = f&quot;Circle at X: {self.x}, Y:{self.y}&quot;
              return circle_position
  </code></pre>
  <p>My Point class which is supposed to read circle position at any given moment. Problem is (I know this code is wrong) I want to use <code>self.x</code> and <code>self.y</code> from Player class which are coordinates of player from spawn moment and I don't want to repeat whole code again. I don't know if that's possible? And how?</p>
  <p>Rest of the code with <code>def main()</code></p>
  <pre><code>def constantly_display(window, player):
      window.fill(pygame.Color(&quot;white&quot;))
      player.draw(window)
      pygame.display.update()
  
  def main():
      run = True
      p = Player(random.randint(35, screen_width - 40), random.randint(35, screen_height - 40),
                 pygame.Color((random.randint(0, 200)),
                              (random.randint(0, 200)),
                              (random.randint(0, 200))), 40, 5)
      c = Point(p, p)
      p.getposition = c
      while run:
          p.getposition.get_circle_position()
          for event in pygame.event.get():
              if event.type == pygame.QUIT:
                  run = False
                  pygame.quit()
          constantly_display(screen, p)
  main()
  </code></pre>
  <p>Another problem is how to connect all that into <code>def main()</code>? (Code/Syntax improvements gladly appreciated)
  Thank you!</p>