Python and Text

I would like to know if it is possible to create a new text object in
blender using python. I am new to python have looked over the
functions listed in the Blender 2.0 manual. But yet have seen how
I could create a new text object of a random number with a python script?

Is this possible? If so could someone show me the line of code that would do this?

Use the Blender.Text module:

import Blender.Text,random
text=Blender.Text.New(name)
text.write('blabla')
#or to write a random number from 0 till 10
text.write(str(random.randrange(10)))

It’s also possible to retrieve a text by name with Blender.Text.get(name)