Problems With Creating Modules [Solved]

This is a very trivial problem and I hope I’m not testing anyones patience. Anyways, here it goes: I’m trying to create two separate python files, one that will handle input and another that will handle everything else (I’m starting small, I hope to separate it more, but I’m just starting with this for now).

As of now, whenever I run the file it returns an error claiming that my Input class has no attribute ‘getitem’.

I’m going to attach a zip that contains all my code, hopefully someone will tell me how to properly handle this situation. Sorry for the attrocious code, I’m still learning :slight_smile:.
help!.zip (213 KB)

Why are you doing this:

		self.input_control = Input()
		self.input_control.keymap = Input()

What you are doing above is creating a Input object and assigning it to self.input_control. Then you are creating another Input object and assigning it to input_control.keymap.

You only need to create the object once, you’ll be able to access the keymap variable after that without any extra work.

So, to fix it remove this line:

		self.input_control.keymap = Input()

Additionally: be careful with your naming conventions. Your ‘Input’ class is fairly general and might clash with other python builtin objects.

It’s working now, thanks!