How can I execute Blender from a script? I am doing a big animation project and I need to use a python script to do it. As a first test to understand how it works. I am using this script found here 
blender script

import Blender
from Blender import *
from Blender.Scene import Render

scn = Blender.Scene.Get("Scene")     
context = scn.getRenderingContext()

context.extensions = True
context.renderPath = "c:\\temp"
context.sizePreset(Render.PAL)
context.imageType = Render.TARGA
context.fps = 25
context.sFrame = 1       
context.eFrame = 100         

context.renderAnim()


to execute this script, i used this command 

blender --background --python runblender.py


I got this error: 

Traceback (most recent call last):  
File "/Users/xxx/Desktop/pythonscript/runblender.py", line 1, in &lt;module&gt;
    import Blender
ImportError: No module named 'Blender'

Blender quit
If you are using Blender 2.5 onwards, it doesn't have a Blender module, the script you are trying to run was written for 2.49 or lower.

The equivalent script for Blender 2.7+ would be something like:

import bpy

c = bpy.context.scene
r = c.render

r.use_file_extension = True
r.filepath = 'c:\\temp'

#Set PAL 16:9 settings manually
r.resolution_x = 720
r.resolution_y = 576
r.pixel_aspect_x = 16
r.pixel_aspect_y = 11

r.image_settings.file_format = 'TARGA'
r.fps = 25
c.frame_start = 1       
c.frame_end = 100         

bpy.ops.render.render(animation=True)