I know this question has been posted alot, however I cannot get my code to work. I have 2 classes, Main and PlayerLogic. I want to create multiple PlayerLogic objects within a loop, however I am getting this error "TypeError: 'module' object is not callable"
EDIT: I didnt mention that the classes are in different files with the exact same name of the class
class Main:
import PlayerLogic
numPlayers = int(input("How many player would you like? [excluding you]"))
players = []
for i in range(numPlayers):
players.append(PlayerLogic(i))
class PlayerLogic:
import random
def __init__(self,name):
self.name = str(name)
players.append(PlayerLogic.PlayerLogic(i))import PlayerLogic?import PlayerLogicis importingPlayerLogic.py. To import the class, tryfrom PlayerLogic import PlayerLogicplayerlogicand the classPlayerLogic.