Running a Python script when a page is loaded

Discussion in 'Python' started by Andrew Chalk, Aug 28, 2003.

  1. Andrew Chalk

    Andrew Chalk Guest

    I am developing a CGI app, When the user loads my page I want to populate an
    HTML 'select' box (drop down menu) with items from a database. What is the
    best way to get my Python procedure that does this called when the page is
    loaded?

    Many thanks
    Andrew Chalk, Aug 28, 2003
    #1
    1. Advertising

  2. Andrew Chalk wrote:
    > I am developing a CGI app, When the user loads my page I want to
    > populate an HTML 'select' box (drop down menu) with items from
    > a database. What is the best way to get my Python procedure that
    > does this called when the page is loaded?


    Normally a CGI app generates the entire page, so you'd already be running
    Python code and would just call your function at the right place. Or is
    there more to the question that I missed?

    If you're running Apache, you can use mod_rewrite to get rid of all the
    cgi-bin/scriptname?querystring cruft. For example, at my Geary Central site:

    http://www.geary.com/

    All of the pages including the home page are generated by Python scripts
    (the MoinMoin wiki software), but the URLs look like ordinary static URLs
    because mod_rewrite translates them.

    -Mike
    Michael Geary, Aug 28, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marcelo Birnbach [MS]
    Replies:
    0
    Views:
    3,321
    Marcelo Birnbach [MS]
    Jun 28, 2003
  2. Udo Corban
    Replies:
    0
    Views:
    3,839
    Udo Corban
    Jan 23, 2004
  3. Benjamin Rutt
    Replies:
    2
    Views:
    934
    Peter Hansen
    Dec 20, 2005
  4. pbd22
    Replies:
    2
    Views:
    297
  5. Joe Nine
    Replies:
    3
    Views:
    101
    Thomas 'PointedEars' Lahn
    Mar 28, 2010
Loading...

Share This Page