Embed a Python script in .blend? I have a .blend file and an accompanying python script that needs running very often when the .blend file is open.

As such, I wish to just "embed" the script into the text editor window. This way, I only need to save one .blend file instead of a .blend and a .py. The ideal startup window of the .blend file looks like this.



Can this be specified when I create this .blend file with Python?
Name the text datablock something.py and tick the 'register' checkbox. It'll run whenever you load the file, just like you want. 

You do need to enable autorunning Python scripts in your user preferences (this is disabled by default for security reasons).