importing/from

hi all, i have a problem
whenever i try to import a custom file like
from source.missiondata import *
it says it cant find it.

“it” is a nasty beast, isn’t it? I guess pointing an M16 at “it” doesn’t help much (whoever or whatever “it” is).

Seriously, this is a bit unspecific, don’t you think so?

With “import” you can import “modules” into the namespace. Modules can be organized in “packages”. If any of these terms is new to you then you should read the Python tutorial on the Python site.

So, to have “from source.missiondata import *” working have to have

  • a package called source
  • a module called missiondata

This could be done by following file structure

source/
    __init__.py
    missiondata.py

You probably have either misspelled anything or forgotten to create an init.py file. Or the package “source” is not on the Python search path.

enn0x

yeah sorry bout that. Well the thing is that i forgot the init.py lol. But now idk how to start functions from other py files like i did self.level.testmap() but it says no attribute found, which means it cant find it rite?