Right,I solve this in other thread. Thanks to aya42.
f=open('file.txt', 'r') means reading from the file.
f=open('file.txt', 'w') means writing from the file.
Here you go the code:
from mod_python import apache
f=open('file.txt', 'r') #you can read also xml,html files and so on...
req.content_type='text/plain' #if you want to read xml, req.content_type='text/xml'