Classes in separate files (Python 3)
DanielNorthcott (0)

How to I use a class that is not in my main file on repl.it. The class' name is Player
import Player - does not work
Console: ModuleNotFoundError: No module named 'Player'
human = Player("Human") - Does not work too if i don't import
Console: NameError: name 'Player' is not defined

Thank you for the help :D

You are viewing a single comment. View All
JoshDaBosh (77)

use

from {fileName[:-2]} import {className}