Thanks for the reply Melvyn and Babatunde. So my script is, using the parameters, to search in a database and then spitting out the output back as CSV. I wish to return the CSV and also display the output in the table on my html template. Ok, so adding it to view makes more sense, but how do i connect or execute that view, on the click of the submit button?? On Jul 7, 2012 1:42 AM, "Melvyn Sopacua" <m.r.sopa...@gmail.com> wrote:
> On 7-7-2012 0:20, Smaran Harihar wrote: > > > I am trying to execute a python script on submit button on a html file. > > > > So i have created a view which renders a html template file and on > > 'submit', I wish to send few parameters to the py script. > > > > I wanted to know, > > > > 1. where should I keep my py script? > > Anywhere you want. It's probably best you describe what your script > does. We don't really understand why you want to execute a script and > not just put that code in a view function. > Other than that, a python script you want to execute is no different > than a sh script or binary command, so you'll need to use python's > subprocess or os module functions, pass arguments in proper shell syntax > and read output. > -- > Melvyn Sopacua > > > -- > 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. > > -- 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.