Newbie and Page Re-Loading
Bruno Desthuilliers
bruno.42.desthuilliers at wtf.websiteburo.oops.com
Fri May 4 13:00:03 EDT 2007
mosscliffe a écrit :
> I am very new to this python world, but I do like the look of the
> language / syntax, though I have had some problems with indenting
> using a text editor.
There's no shortage of smart code editor having a decent support for
Python.
>
> I have managed to get my ISP to execute .py files on their server.
Great.
> I have created a .py file and it does in fact do the various little
> tasks I have asked it to do.
>
> Now i need to get a bit more serious.
>
> I wish to have a web page with a search form at the top and on
> processing the form re-load my current page, but with the various
> search results.
>
> Do I just add my script name to the Action part of the Form
your script's url would actually be better.
> and how
> can I pass variables, other than form variables to each execution of
> the script. If I have to use hidden form variables, how would I alter
> them for each page.
Since you're talking about redisplaying the page with results added, I
assume this page is dynamically created by another python script. If so,
you can put the form's generation in a function that will take
page-specific params and put them in the appropriate hidden fields. Then
just call that function from the script generating your web page.
> I suppose I am looking for some sort of session management,
Depends... But if it's just to know which page called the script, you
don't need sessions here.
> but I have
> not been able to track one down as yet.
I'm suppose your doing CGI scripts. I've seen some basic session
management for CGI somewhere, but that's mostly old stuff.
> I am running on an ISP, with
> no knowledge of python, so asking about getting packages loaded will
> not be an option.
You can install packages in your own space - you'll just have to make
sure that there in your python path.
> I have 'Python in a Nutshell', but it is a bit sparse on everyday web
> page examples.
"everyday web pages examples" in Python usually imply a more
sophisticated framework and a long running process (think Zope, Django,
CherryPy, Pylons, mod_python, wsgi, fcgi etc...)
More information about the Python-list
mailing list