Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Running a Python script when a page is loaded

Reply
Thread Tools

Running a Python script when a page is loaded

 
 
Andrew Chalk
Guest
Posts: n/a
 
      08-28-2003
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


 
Reply With Quote
 
 
 
 
Michael Geary
Guest
Posts: n/a
 
      08-28-2003
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can code in a script file start running before file loaded? Joe Nine Javascript 3 03-28-2010 06:54 PM
Script in AJAX-loaded page inside parent page not firing pbd22 Javascript 2 09-11-2009 08:38 PM
modify a long-running python script while it is running? Benjamin Rutt Python 2 12-20-2005 01:42 PM
java -verbose doesn't show "loaded from" for classes loaded from custom jars in the classpath Udo Corban Java 0 01-23-2004 09:32 AM
Re: how to programatically give assembly loaded from network the same trust as those loaded from local host? Marcelo Birnbach [MS] ASP .Net 0 06-27-2003 11:51 PM



Advertisments