UPBGE. src/

Hi. This may be trivial, or may be I just miss something, but I can’t find a way to store all may python code in src/ folder :frowning_face:
I just want classic simple project folder layout:

  • my_game/
    • main.blend
    • src/
      • Game.py

Is it possible?
P.S. So, say in my pyController, I just whant to reference module like Game.foo, not src.Game.foo

It is something like that:

game.rar (77.5 KB)

(the .blend is saved with upbge0.3 alpha)

The logic bricks looks like that:

Thx for reply Owl! But your example is exactly what I try to avoid…
I just want to put “myscript.applyRotation” into controller, while myscript.py been live in the scripts folder…

Think about something like “classPath” - list of dirs where the iterpreter is looking for your scripts. It contains ./ now. And I want add ./src to this list…

You could try adding your src folder to the paths that Python searches in to load stuff:

import sys
sys.path.append("src\\")

Throw that into a script that runs once at the start of your project.

You might need to put the full path in there.