Is there a standard solution for writing HTML web pages with Python? I
don't know that much about web programming, but basically I want to generate
some internal reports on a web page.
It doesn't need to be fancy, just basic tables and linking, maybe indexing
and navigation, but I want it to all look nice and I want to be able to
change the formatting easily without combing through source code (hence my
next question about CSS).
I know there newer things like CSS and XHTML -- are these more or less
effort to generate? i.e. are they more complicated, or do they have more
uniform syntax? What do they necessarily buy you?
I searched the python website and I have seen HTML parsers, but no examples
of generators. I searched for "Python HTML" and "Python CSS" and found some
stuff -- but it doesn't seem like there is a "standard" solution that is
EASY for non-expert web programmers to use. I am an experienced
programming, but I don't know that much about all the alphabet soup that is
web programming.
thanks,
MB 8 2915
You could always try HTMLgen, though I don't know how much CSS it supports.
HTH
J
Moosebumps wrote: Is there a standard solution for writing HTML web pages with Python? I don't know that much about web programming, but basically I want to generate some internal reports on a web page.
It doesn't need to be fancy, just basic tables and linking, maybe indexing and navigation, but I want it to all look nice and I want to be able to change the formatting easily without combing through source code (hence my next question about CSS).
I know there newer things like CSS and XHTML -- are these more or less effort to generate? i.e. are they more complicated, or do they have more uniform syntax? What do they necessarily buy you?
I searched the python website and I have seen HTML parsers, but no examples of generators. I searched for "Python HTML" and "Python CSS" and found some stuff -- but it doesn't seem like there is a "standard" solution that is EASY for non-expert web programmers to use. I am an experienced programming, but I don't know that much about all the alphabet soup that is web programming.
thanks, MB
Moosebumps wrote: Is there a standard solution for writing HTML web pages with Python? I don't know that much about web programming, but basically I want to generate some internal reports on a web page.
There are several possible HTML generators for Python:
HTMLgen http://starship.python.net/crew/frie...html/main.html
HyperText http://dustman.net/andy/python/HyperText/
XIST http://www.livinglogic.de/Python/xist/
[...] I know there newer things like CSS and XHTML -- are these more or less effort to generate? i.e. are they more complicated, or do they have more uniform syntax? What do they necessarily buy you?
You can do more styling with CSS than you can do with HTML.
[...]
Bye,
Walter Dörwald
Moosebumps wrote: I know there newer things like CSS and XHTML -- are these more or less effort to generate? i.e. are they more complicated, or do they have more uniform syntax? What do they necessarily buy you?
I don't know anything about Python in relation to dynamic web pages, but
I've worked quite a lot with PHP in this respect. XHTML is a very clean
implementation of HTML, and should, at least in principle, be much more
easily rendered by any browser than ninetyish tag soup. From a coder's
point of view, it also of course has a lot of aesthetic appeal.
The nicest thing about the XHTML/CSS combination, is the clean division
between structure and presentation. The <FONT> tag should go the same
way as the GOTO.
I would recommend to read up the specs of XHTML 1.0 on
<url:http://www.w3c.org/>, write some experimental markup, and then try
to validate it on <url:http://validator.w3.or g/>. You'll get the hang
of it after some iterations.
There are many good tutorials on the net for writing XHTML and CSS; do a
search on Google. You can of course also learn an awful lot by viewing
the source of other people's validating pages.
regards,
--
Leif Biberg Kristensen http://solumslekt.org/
Validare necesse est
"Walter Dörwald" <wa****@livingl ogic.de> wrote in message
news:40******** ******@livinglo gic.de... Moosebumps wrote:
Is there a standard solution for writing HTML web pages with Python? I don't know that much about web programming, but basically I want to
generate some internal reports on a web page.
There are several possible HTML generators for Python: HTMLgen http://starship.python.net/crew/frie...html/main.html HyperText http://dustman.net/andy/python/HyperText/ XIST http://www.livinglogic.de/Python/xist/
Thanks for those links, they look like what I'm looking for. Does anyone
have any comment on which one of these requires you to have the least amount
specific web programming knowledge? i.e. I know basic HTML, and I am an
experienced C programmer, but haven't really delved into the specifics of
it... never really wanted to clutter up my mind with the alphabet soup of
web programming : ). I was thinking that there was some Python library
that would wrap the functionality of these languages in some nice consistent
OO python interface. It looks like all of these are exactly that, from what
I gather, which is great.
That is, I would not like any specific HTML tags anywhere in my own code,
and it seems like that is what they will allow me to do. But I would be
interested to hear opinions/experiences with these packages.
thanks,
MB
Moosebumps wrote: "Walter Dörwald" <wa****@livingl ogic.de> wrote in message news:40******** ******@livinglo gic.de...
[...]
There are several possible HTML generators for Python: HTMLgen http://starship.python.net/crew/frie...html/main.html HyperText http://dustman.net/andy/python/HyperText/ XIST http://www.livinglogic.de/Python/xist/
Thanks for those links, they look like what I'm looking for. Does anyone have any comment on which one of these requires you to have the least amount specific web programming knowledge?
Each of them requires you to know what the HTML tags mean.
i.e. I know basic HTML, and I am an experienced C programmer, but haven't really delved into the specifics of it... never really wanted to clutter up my mind with the alphabet soup of web programming : ). I was thinking that there was some Python library that would wrap the functionality of these languages in some nice consistent OO python interface. It looks like all of these are exactly that, from what I gather, which is great.
That is, I would not like any specific HTML tags anywhere in my own code, and it seems like that is what they will allow me to do. But I would be interested to hear opinions/experiences with these packages.
As the author of XIST I'm naturally biased, but one advantange of XIST
is that it's still actively maintained. HTMLgen and HyperText don't
seem to be.
To see an example take a look at http://www.livinglogic.de/viewcvs/in...xist/HOWTO.xml.
This XML file doesn't contain any HTML tags, but gets converted to
HTML (see http://www.livinglogic.de/Python/xist/Howto.html), to
XSL-FO (see http://www.livinglogic.de/Python/xist/Howto.fo) and
PDF (see http://www.livinglogic.de/Python/xist/Howto.pdf)
HTH,
Walter Dörwald
Moosebumps wrote: That is, I would not like any specific HTML tags anywhere in my own code, and it seems like that is what they will allow me to do. But I would be interested to hear opinions/experiences with these packages.
I spent a couple of days last week getting to know each of these. I
found HTMLgen as I was getting desperate with the tag soup in my code
and quickly converted the code to use it. Then I found out it only does
HTML 3.2, missing end tags of elements and such. Some parts of the model
also weren't as generic as they should have been.
Next I stumbled upon HyperText, which seemed to fix all the
incosistencies of HTMLgen, and also output XHTML 1.0. THe problem was
that I found no way to use web forms with it. The 'name'-attribute of an
input tag seemed to be impossible to set(ie. foo.name didn't do the
right thing, foo['name'] was illegal and there weren't any obvious false
names like klass <-> class). Fixing this would have been easy, but I
decided to look for alternatives.
The final option seemed to be XIST, of which HTML seems to be only small
part. It seems to implement HTML in a consistent fashion, allowing all
the necessary tag attributes to be set and otherwise providing a nice
interface to the horrible world of web :)
-- Tuure Laurinolli
Thanks to all for the feedback -- that was very useful! I think I will go
with XIST.
MB
"Tuure Laurinolli" <tu***@laurinol li.net> wrote in message
news:c4******** **@plaza.suomi. net... Moosebumps wrote:
That is, I would not like any specific HTML tags anywhere in my own
code, and it seems like that is what they will allow me to do. But I would be interested to hear opinions/experiences with these packages.
I spent a couple of days last week getting to know each of these. I found HTMLgen as I was getting desperate with the tag soup in my code and quickly converted the code to use it. Then I found out it only does HTML 3.2, missing end tags of elements and such. Some parts of the model also weren't as generic as they should have been.
Next I stumbled upon HyperText, which seemed to fix all the incosistencies of HTMLgen, and also output XHTML 1.0. THe problem was that I found no way to use web forms with it. The 'name'-attribute of an input tag seemed to be impossible to set(ie. foo.name didn't do the right thing, foo['name'] was illegal and there weren't any obvious false names like klass <-> class). Fixing this would have been easy, but I decided to look for alternatives.
The final option seemed to be XIST, of which HTML seems to be only small part. It seems to implement HTML in a consistent fashion, allowing all the necessary tag attributes to be set and otherwise providing a nice interface to the horrible world of web :)
-- Tuure Laurinolli
"Moosebumps " <mo********@moo sebumps.com> wrote in message news:<yL******* ************@ne wssvr25.news.pr odigy.com>... Is there a standard solution for writing HTML web pages with Python? I don't know that much about web programming, but basically I want to generate some internal reports on a web page.
First ask yourself if you need to generate pages dynamically, or is
pre-rendering and serving them up statically fine? The latter is much,
much simpler to code for. For what you describe this may be all you
need. There's no shortage of frameworks for doing the former though (I
believe Quixote is well regarded as a "programmer-friendly" solution,
for example).
For templating, as long as you're comfy with a modicum of OO
programming then I'd recommend my HTMLTemplate module:
<http://freespace.virgi n.net/hamish.sanderso n/htmltemplate.ht ml>.
Compiles HTML templates to a simple Python object model than can be
manipulated programmaticall y. Small and simple with no external
dependencies, clean separation between code and markup, and a very
clean, compact API; easily outstrips the old-school bloatware
ASP/PSP-style systems with their horrible code-in-markup soup.
On the offchance you need to do arbitary markup generation (for
generating really irregular tables and stuff that can't easily be
templated), there's always HTMLgen but it's pretty old and hoary now.
Donovan Preston's Nevow.Stan module is much more modern; see
<http://www.python.org/pycon/dc2004/papers/60/Nevow2004Tutori al.html>
for an introduction.
I know there newer things like CSS and XHTML -- are these more or less effort to generate? i.e. are they more complicated, or do they have more uniform syntax? What do they necessarily buy you?
CSS (cascading style sheets) are for styling (and - if you're brave -
page layout). Absolutely fine for styling text (waaay nicer than using
<font> tag crap). Many browsers still have problems with more complex
presentational stuff, but it doesn't sound like you'll be needing
that. Not something you should have to generate programmaticall y -
whole point of CSS being you just write it once and apply it to your
entire site.
XHTML is just a tidied up version of the HTML standard; enforces a few
things that were optional in HTML, e.g. correct closing of element
tags, the main advantage of this being it can be parsed, manipulated,
etc. as XML.
I am an experienced programming, but I don't know that much about all the alphabet soup that is web programming.
Yeah, there's a lot o' crap to avoid out there. Still, a good start'd
be finding yourself a nice modern introduction to writing HTML and
CSS, and go from there. There's scads of stuff online for this - main
problem's knowing the good from the bad. Reckon you some find some
good links at <http://webstandards.or g/learn/standards/> (though you
may have to sift through a bit of geeky buzzword evangelism waffle to
get to it:). You won't need the advanced stuff and the basics are
easy. (Honest.<g> Hint: if a tutorial makes it sound complicated, find
a better tutorial!)
HTH This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Allan Bredahl |
last post by:
Hi All
I'm trying hard to find out how to transform XML to HTML using XSLT files.
I have searched all over for some examples on how to do this, but I have had
no succes with any of them.
Can sombody please direct me on how to fill in this function:
|
by: a |
last post by:
Save text file as html kloepper 17:42 23 Jul '04
I'm using httpwebresponse and a StringBuilder to return a stream that originates as a file with the .txt suffix (My download code converts the html tags in this text file to well formed XHTML tags). The contents of the file contain html tags and the data in those tags.
eg.,
<table...
|
by: guy |
last post by:
Does .NET have a class or set of functions that facilitate the creating and
writing of html files?
I have been creating files in streams and constructing html strings and
writing them out but it seems that a class could facilitate this better.
Thanks
|
by: Rick Spiewak |
last post by:
I need to generate a "buy" button as part of an ASP.NET page - this consists
of a small HTML form with hidden fields, conforming to the requirements of a
merchant credit card processor. PayPal is similar.
I'm succeeding in doing this by using Writer.Write to emit my HTML, at least
as far as getting it to work.
However, depending on where...
|
by: Ryan McLean |
last post by:
Hello everyone!
What I am trying to accomplish is as follows: I have a .aspx page
where I display the user's information. This consists of a datagrid,
several labels, etc. I would like to send this same information in
the body of an email. Now, I know I could simply rewrite the contents
into an html string thingy and just put stuff like...
| |
by: Lloyd Sheen |
last post by:
This IDE is driving me nuts. I needed another button so I copied an
existing one, changed the Text and the id and position by drag and drop.
Well then I run and get the following:
Control 'Button19' of type 'Button' must be placed inside a form tag with
runat=server
Can the IDE not do what it is supposed to do. It seems that it is a...
|
by: Chad |
last post by:
In our application, I would like to send out HTML mail. TO do so, I must do something like this:
Mail.Body = <raw HTMLTEXT String>
Hence, I would like to know how to get the HTML text for Web Controls.
You'll notice below in lines 33-37 that that code does correctlt return the HTML for a textbox. How do I make it generic so it returns the...
|
by: daFou |
last post by:
Hi All.
All I want to do is get the HTML of a control on my page at postback into a
string in my code behind.
In ASP.NET 1.0 this used to be simple:
Dim lStringWriter As System.IO.StringWriter = New System.IO.StringWriter
Dim lHtmlTextWriter As System.Web.UI.HtmlTextWriter = New
System.Web.UI.HtmlTextWriter(lStringWriter)...
|
by: JackO |
last post by:
Does anyone have an example in VB.NET on how to create an HTML file.
|
by: Lloyd Sheen |
last post by:
Perhaps I have missed something but what I would like to do is have a more
"controlled" method of generating HTML from a web service.
I can create items using HtmlTable, HtmlTableRow, and HtmlTableCell but is
there a quick method once the table has been built to get the HTML, put it
in a string for return the browser call for the web...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |