importing python scripts

how do i import python scripts into the game engine scripts?

like:

import y_engine

i just want to import my game engine logic into python.

i want to create a regular word for things like:

cont = bge.logic.getCurrentController()

and others like scene etc

so i wont have to type it for every object in my game.

ill just write"import y_engine"

and all the vars i need will be initiated.

so i could call cont and it would been created because i imported y_engine.

There are some templates that you can use, check it out under the text editor window.

you dot understand i dont need templates.

lets say this is a text file(block whatever) called myengine:

#######my engine##########
code class oop stuff bla bla…
##########################

and then i have another that i want the class i wrote myself included

###########another script###############
include my engine

extand my endine class code…

some more code…
###################################

you can imegine my reaction to your response after searching for an answer all day long.

do you think im stupid enough to ask such a question? like “where is the useless default templates”.

sorry if im angry.its not personal.

how can a software development company can be so stupid with documentation/ learning materials, the people who create api and frameworks of code only they master and can use amazes me,every time. blender is no different why do i have to scrape each piece of information i can find on unofficial tuts?
didnt it cost them money to develop it? the least they can do is write 3-4 basic guides and 1 practical example(pong?).

dosnt anyone here use oop? or include code? everyone here copy paste old code and work with a 1000 line code(text box whatever).

Save your functions, procedures and imports in a file called, say, mydefinitions.py, and put it in your current directory.
Then with:

from mydefinitions import *

you will have access to all the functions and imports available in “mydefinitions”.

Not forgetting that if you import variables, these will remain the same for all other import calls. Therefore, it is often best to use some form of ‘context’. This may be with a context manager (the ‘with’ statement is part of this mechanism) or updating the globals dictionary from a get_context(cont) method in the module