1

In essence I want to run existing python scripts through a web browser, display the text and plots(if any) and also keeping the ability to run them through the command line.

I am wondering is there any toolkit that can help me with the development.Also it would be nice if the toolkit does or allows JavaScript based interactive plots.

Thanks! -Abhi

1 Answer 1

1

WSGI is designed for just this purpose - it provides an interface for a web server to initiate python scripts.

You probably don't want to work with WSGI in the raw. Flask is a straightforward, simple framework you might use for this.

The details of how to actually build a WSGI web server are well beyond the scope of a stackoverflow answer - you can find plenty of tutorial docs on Flask's website.

Sign up to request clarification or add additional context in comments.

4 Comments

thanks for a quick response. I took a quick peek at Flask..one question : does it only work when the script is run from a command line and one can see the output on a webserver ? I doubt but not sure. What I want is to run the same script from a webserver and get the results back in a web page..
@abhi Sure, that's not hard. In your flask application's script, you'd import whatever other script you'd need and execute functions from your imported script.
that sounds great...I just need to learn how to do it..unless I get any other tempting replies, I am gonna try this. I hope the learning curve is not steep with flask..thanks again
Sorry one more thing...it is trivial to inject some JS code into the page through Flask..basically want to render the plots as interactive java script based plot (using JQplot may be) instead of static matplotlib plots for this application..an example would be great if you are aware of one :) cheers!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.