Mailing List Archive

Include statements with python scripting
How do you do an include statement in python? I know that in Cold Fusion it
would be "<cfinclude template="blue_header_noad.html">" and in an shtml file
it would be "#include http://data.pilotonline.com/connect2/blue_header.html"
but I need to know how this is done in Python scripting. This script is
being embedded in a template for a classifieds page. I have something like
this so far:

<html><head><title><!--#var name--> Search Results</title></head>

<!--#if mainclass == Employment:-->
<!--#include http://data.pilotonline.com/connect2/blue_header.html-->
<!--#else:-->
<!--#include http://data.pilotonline.com/connect2/default_header.html-->

<font size="+1">Main classification: <!--#var mainclass--> .....

I just need to know If that is how #include works, or is there some other
way that this is supposed to be done. Please let me know as soon as
possible. I don't check the email address in the sig over the weekend, so
please send any emails to webolutionary@webolutionary.com

--
Sean Robertson
Multimedia Artist, PilotOnline.com
seanr@infi.net
Include statements with python scripting [ In reply to ]
On Fri, 30 Jul 1999 15:24:38 -0400, Sean Robertson wrote:
>How do you do an include statement in python? I know that in Cold Fusion it
>would be "<cfinclude template="blue_header_noad.html">" and in an shtml file
>it would be "#include http://data.pilotonline.com/connect2/blue_header.html"
>but I need to know how this is done in Python scripting. This script is
>being embedded in a template for a classifieds page. I have something like
>this so far:

><html><head><title><!--#var name--> Search Results</title></head>

This isn't Python -- I'm sure you're trying to ask about Zope. Remarkable
product, written in Python (lovely plumage). But not Python. Try
visiting www.zope.org for more info.

> <!--#include http://data.pilotonline.com/connect2/blue_header.html-->

I wasn't aware of a #include in Zope; I've been using #var. Generally
speaking, it doesn't make any sense to include an entire HTML page inside
another, so I think you might possibly be confused.

>Sean Robertson

--
-William "Billy" Tanksley
Include statements with python scripting [ In reply to ]
Sean Robertson <seanr@infi.net> wrote:
> How do you do an include statement in python? I know that in Cold Fusion it
> would be "<cfinclude template="blue_header_noad.html">" and in an shtml file
> it would be "#include http://data.pilotonline.com/connect2/blue_header.html"
> but I need to know how this is done in Python scripting. This script is
> being embedded in a template for a classifieds page. I have something like
> this so far:
>
> <html><head><title><!--#var name--> Search Results</title></head>
>
> <!--#if mainclass == Employment:-->
> <!--#include http://data.pilotonline.com/connect2/blue_header.html-->
> <!--#else:-->
> <!--#include http://data.pilotonline.com/connect2/default_header.html-->
>
> <font size="+1">Main classification: <!--#var mainclass--> .....

if I'm not mistaken, that's zope DHTML code. it's
definitely not an ordinary Python script...

it probably works better if you send zope questions
to one of the zope mailing lists:

http://www.zope.org/Community/

</F>
Include statements with python scripting [ In reply to ]
William Tanksley <wtanksle@dolphin.openprojects.net> wrote in message
news:slrn7q44ck.8kv.wtanksle@dolphin.openprojects.net...
> On Fri, 30 Jul 1999 15:24:38 -0400, Sean Robertson wrote:
> >How do you do an include statement in python? I know that in Cold Fusion
it
> >would be "<cfinclude template="blue_header_noad.html">" and in an shtml
file
> >it would be "#include
http://data.pilotonline.com/connect2/blue_header.html"
> >but I need to know how this is done in Python scripting. This script is
> >being embedded in a template for a classifieds page. I have something
like
> >this so far:
>
> ><html><head><title><!--#var name--> Search Results</title></head>
>
> This isn't Python -- I'm sure you're trying to ask about Zope. Remarkable
> product, written in Python (lovely plumage). But not Python. Try
> visiting www.zope.org for more info.
>
> > <!--#include http://data.pilotonline.com/connect2/blue_header.html-->
>
> I wasn't aware of a #include in Zope; I've been using #var. Generally
> speaking, it doesn't make any sense to include an entire HTML page inside
> another, so I think you might possibly be confused.

I was told that the program that uses this template uses python, but am
checking out zope nonetheless. The reason I need to include and external
html fragment is that I want the page to have two seperate interfaces
depending on which part of the site the user is coming from. If they are
searching CareerConnection, the mainclass variable will be Employers and the
results page needs to fit the interface of the CareerConnection site,
otherwise, they should get the old default interface. I was using
"#include" only as a placeholder until I figured out how to do it in python.
If you know how, please let me know.
Include statements with python scripting [ In reply to ]
On Fri, 30 Jul 1999 17:18:45 -0400, Sean Robertson wrote:
>William Tanksley <wtanksle@dolphin.openprojects.net> wrote in message

>> On Fri, 30 Jul 1999 15:24:38 -0400, Sean Robertson wrote:
>> >How do you do an include statement in python? I know that in Cold Fusion
>it

>> ><html><head><title><!--#var name--> Search Results</title></head>

>> This isn't Python -- I'm sure you're trying to ask about Zope. Remarkable

>> I wasn't aware of a #include in Zope; I've been using #var. Generally
>> speaking, it doesn't make any sense to include an entire HTML page inside
>> another, so I think you might possibly be confused.

>I was told that the program that uses this template uses python, but am
>checking out zope nonetheless.

The program that reads that template is Zope, and uses Python.
Nonetheless, that template isn't written in Python :).

>The reason I need to include and external
>html fragment is that I want the page to have two seperate interfaces
>depending on which part of the site the user is coming from. If they are
>searching CareerConnection, the mainclass variable will be Employers and the
>results page needs to fit the interface of the CareerConnection site,
>otherwise, they should get the old default interface. I was using
>"#include" only as a placeholder until I figured out how to do it in python.
>If you know how, please let me know.

It depends on your environment, and the Zope people will be able to help
you a lot more, but my Zope website uses things like:

<!--#var page_header-->

to handle that kind of thing. The correct page header is automatically
inserted there depending upon where you are -- no need for ifs. Look up
an example of 'acquisition' in the Zope docs.

Once you learn it (and it's easier than it looks), you'll never look back.

--
-William "Billy" Tanksley