Newbie and Page Re-Loading

mosscliffe mcl.office at googlemail.com
Fri May 4 14:15:55 EDT 2007


Bruno,

Many thanks for your very helpful reply.

I am trying WingIDE Personal as an editor, up to now it seems OK.

My ISP is running Python 2.4.3 and does not know about mod_python.

I do not want to run a framework yet.  I would like to understand
python at script level, before adding more aspects to learn, like
frameworks.

I think I get your idea about hidden fields and how to alter them.

My single page script should work something like this

DisplayHTMLHeaderandBodyHeader
Check if this is a Re-Load (HiddenField would not exist first time I
am assuming)
Display SearchSection with previous SearchRequest
If SearchRequest is True: Get and Display Results
Display TrailerHTMLandTrailerBody

......... Wait for NewSearch or NextPage

Does the above make sense or is there a better way ?

How do I get the directory of my modules into the Python Path

Is there a lightweight Https Server I could run locally (WINXP), which
would run .py scripts, without lots of installation modifications ?

Thanks

Richard

On 4 May, 18:00, Bruno Desthuilliers <bruno.
42.desthuilli... at wtf.websiteburo.oops.com> wrote:
> 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