I come from a mostly Java background, but have recently been delving into some Python. I've been mostly getting it, but there's some syntax that seems really weird to me. I have this project I'm working on that contains multiple files/ classes. I have one class, Mesh.py:
class Mesh:
def __init__(self, name):
#dostuff
that I want to instantiate in another file, Main.py. I noticed two things,
- I have to import Mesh, which seems odd to me, since it's in my project,
To create a Mesh I have to do this:
mesh = Mesh.Mesh('name')
which seems super awkward. Why can't I just do
mesh = Mesh('name')
Am I doing something wrong here, or is this just an unavoidable part of Python?