Need quick start for Python

I don’t know how to set up my init script to BGE. The init script would create the world space/scene, and add camera.

In init script, I also want assign a script which is equivalent to GTK/pointer motion_notify callback.

The whole BGE system is still quite confusing. My own application only needs this init/motion_notify/button press. But can I add menu system without cluttering the scripts in my application?

I would like BGE to be an alternative to C/GTK programming environment.

Hmm… I have now scripts camera_init.py, camera_mouse.py, and camera_keyboard.py. They are attached to the camera object. I wanted clear execution order: camera_init.py runs only once. But maybe that is not possible cleanly. Do I have to code different states manually?

My application will have about only these scripts attached to the camera. E.g., to grab and move an object, I do hit test and move in these scripts. There are tutorials which attach sensors to the objects, and deals their grab/move there - but they are wrong.

Hook an Always sensor to camera_init.py python controller, and it will only trigger once on the first frame after starting the game.

Sensors (from my perspective) are more like pre-fabbed chunks of code. Putting say, a ray sensor on an object is the same as running a obj.rayCast() (or rayCastTo(), I always get those mixed up), you just trade lack of having to write code for lack of flexibility.
There is nothing wrong with using logic bricks along side python code. There is no need to exclude one for the other.

Can I write Python script which is executed before starting the frame rendering? Or just do every initialization at the first frame? I would create a second thread for loading data from disk, for example. The suggested guide - I’m not sure if it is useful enough.