On 5/1/2009 5:13 AM, pallavi wrote:
> For example lets say my python script is named "science.py" and it
> reads two input files for the input data : abc.txt  and xyz.txt and
> after computation the output file is : output.txt

If abc.txt and xyz.txt are available somehow directly on the application 
server w/o user upload, then you simply need to write a view that parses 
them and serves them out as the appropriate format. If you require users 
to upload abc.txt and xyz.txt, then you have a slightly more complicated 
issue of having another view which accepts those files as uploads.

So the simplest scenario could be something like this:

{{{
from django.http import HttpResponse

from science import my_function

def science_service(request):
     # assuming my_function takes abc.txt and xyz.txt
     # and turns them into some plain text output
     return HttpResponse(
         my_function('abc.txt', 'xyz.txt'), , mimetype="text/plain"
         )
}}}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to