I cannot quite understand what you are after, but I can give a few suggestions.
Run a script using : python name_of_script.py
Write a function that starts when the script is made:
Code:
def start_function():
pass # put code here
if __name__=='__main__':
start_function()
In the above snippet you get the same behavior if you call the code as a script and if you load it as a package and run start_function() yourself.
Again, I hope this helps. If not, try to write what you are missing.