[Tutor] Python vs. PHP

kirk Bailey idiot1@netzero.net
Sun, 27 Jan 2002 18:51:30 -0500


Generally, I like to use SSI for web pages, sith just a touch of CSS
for seasoning. Howlermonkey.net is all SSI/CSS/custom scripts done by
a friend (in perl, which I intend to rectify SOON) and no pages EXCEPT
the web email interface and th pages for TinyList are entirely
generated by scripts.

As a scripting language, I strongly favor Python, and intend to
convert everything over.


alan.gauld@bt.com wrote:
> 
> > flexible, as you can write your entire page in HTML and add the PHP
> > where it's needed, or you can write your entire page in PHP
> > and include HTML where needed (or print it where needed).
> 
> Python (or indeed Perl) can do this too usong CGI techniques:
> 
> print '''<HTML><HEAD><TITLE>The title here</TITLE></HEAD>
> <BODY>
> <!-- Whatever you want here -->
> 
> </BODY></HTML>'''
> 
> So apart from adding a print statement and triple quotes
> it works pretty well. To add code just break the quoted
> sequence in two like so:
> 
> print '''<HTML><HEAD><TITLE>The title here</TITLE></HEAD>
> <BODY>
> <!-- Whatever you want here -->
> '''   # break the html text here
> 
> def foo():
>    print str(5*5) # prints 5 into the HTML
> 
> print '''    # continues the HTML text
> <!-- ret of html here -->
> </BODY></HTML>'''
> 
> So you can insert code into the HTML almost like you
> do in PHP or ASP.
> 
> If course you can use PSP too which works exactly
> like ASP/PHP but using:
> 
> [%
>      # Python code here
>      print "foobar"
> %]
> 
> And On IIS you can even use ASP:
> 
> <% SCRIPT LANGUAGE='Python'>
> 
> <%  print 'foobar' %>
> 
> Or whatever - I'm in an airport lounge without
> access to my ASP books!
> 
> The point is that despite the hysteria generated, there
> is very little to choose between ASP or CGI style web
> scripting.
> 
> Alan G
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor

-- 
 

 -Respectfully,
              -Kirk D Bailey 
               Consulting Loose Cannon

end



  www.howlermonkey.net                 highprimate@howlermonkey.net
  www.sacredelectron.org                         idiot1@netzero.net
  www.tinylist.org                              grumpy@tinylist.org
----------------------------------------------------
Sign Up for NetZero Platinum Today
Only $9.95 per month!
http://my.netzero.net/s/signup?r=platinum&refcd=PT97