[Tutor] using python to write web page

ALAN GAULD alan.gauld at btinternet.com
Thu Jun 16 01:54:13 CEST 2011



From: Michael bridges <micha_el2003 at yahoo.com>

To: Alan Gauld <alan.gauld at btinternet.com>
Sent: Thursday, 16 June, 2011 0:43:35
Subject: Re: [Tutor] using python to write web page

> i do not want to write html, not in whole or in part, nor in reference.
> just 100% python. not from a server.

The code I showed was 100% Python that created an html file 
that could be opened in a browser without a server.

> i want to write the python only code and have python 
> only code make the web page that can be read on 
> any computer with a web browser.

Thats exactly what my code does.

> no server use, no server down load, no server at all.

Thats exactly what my code does.

> no python interrupter.

No idea what you mean here?
If you mean no Python interpreter how do you expect to  
execute the python code?
If you mean you want to read the resultant file without 
using Python then.... thats exactly what my code does.

So does my sample code meet your needs, or is there 
some other requirement that you haven't explained yet?


--- On Wed, 6/15/11, Alan Gauld <alan.gauld at btinternet.com> wrote:

> Python can create html files so if you only want to create
> an html file just do it:
> 
> content = """
> <html><body>
> <P>Hello world</p>
> </body></html>"""
> 
> open("myfile.htm","w").write(contents)
> 

Alan G
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110616/aaf5c8fb/attachment-0001.html>


More information about the Tutor mailing list