python and django: execute python script from django web form?
Question: I have fully functional python program which I run from shell. All arguments
and options are supplied using option parser. What I would like to do is to
create simple web interface for this program using django.

I am stacked on transferring values received from web form to python script ))
Actually how can I execute python script in this way?

Thanks in advance!


Answer: If your python program has a bit that looks like this:

    
    
    import sys
    if __name__ == "__main__":
      args = sys.argv 
      main(args)
    

Then just import it, and call it's main() method with your args in the same
format as sys.argv. Sorted. That would be the pythonic way of doing things.

Otherwise you need a general way of executing an external program from python
- os.system and its friends. This is covered elsewhere.

