I know this question has been asked before but for the life of me I can't seem to understand the answers so I'm here asking for some help with an example. I am not trying to waste anybodies time here so please don't internet yell at me!
I have a class called Enemy with variables. How do I access these variables in another class? Heres my example.
import tkinter
from tkinter import ttk
class Enemy(object):
def __init__ (self, name, attack, defence, gold, health, experience):
self.name = name
self.attack = attack
self.defence = defence
self.gold = gold
self.health = health
self.experience = experience
Enemy1 = Enemy("Enemy Soldier", "5", "1", "10", "10", "30")
class Application(object):
def __init__(self):
self.enemyLabel = tkinter.Label(text= self.Enemy1.name)
self.enemyLabel.pack()
myApp = Application()
myApp.root.mainloop()
This is a very narrowed down version of my code.