On Mon, Jun 9, 2008 at 11:21 AM, Dotan Cohen <[EMAIL PROTECTED]> wrote:
> 2008/6/9 W W <[EMAIL PROTECTED]>:
> I was doing this in PHP:
> $title="Page title";
> include"/path/to/header.php";
>

So in your header.php you had some source:

echo "<head><title>$title</title></head>\n";

or something to that effect?

> In Python I suppose that I will do something like this:
> makeHeader("Page title")
>
> I would define makeHeader() in a class, so that I could use it (and
> other functions) across multiple pages.

Though I'm not entirely sure how you would (and I'm sure one of the
other web frameworks probably already does such a thing), you could
probably create methods (just a function inside a class, from what
I've been told) that could do something along the lines of:

makeHeader.title("Page title")
makeHeader.bgcolor("#000000")
makeHeader.css("css/mystyle.css")

or any other various types of header information you use, if that sort
of thing fits into your needs/wants. Or even like many functions in
python: makeHeader.body("#00ff00", 0, 0, "images/bgnew.gif"), though
my guess is that again, some other web framework already has those
features.

HTH,
Wayne
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to