On May 8, 9:20 am, Albert <albertsu...@gmail.com> wrote:
> I have a small text based python program that I want to make available
> to people who might be behind a firewall or can't install python on
> their office computers, but can access the internet.  It is just an
> algorithm that makes a handful of straightforward calculations on some
> input that the user provides and spits out some text as output that
> they might want to print out on a printer.  I can program python on my
> local machine, but don't know how to make the code accessible from a
> browser.

You could do this quite easily with CherryPy:


    import cherrypy

    class WebApp(object):
        def calc(self, a, b):
            c = int(a) + int(b)
            return str(c)
        calc.exposed = True

    cherrypy.quickstart(WebApp())

This can be called via '/calc/1/2' or 'calc?a=1&b=2'. You can add a
method to provide a form and another to produce a pretty output and
it's good to go.

http://www.cherrypy.org/
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to