0

I want to create Analysis report after creating model for generating cut/fill.

Once it will done, based on this cutfill/table, would be display statics in html format using Python.

Is it possible, and can you tell me how it will done?

2
  • 1
    Can you expand your question - as currently flagged as 'off topic' - please give more details what you are trying to achieve or the question will be closed.
    – Mapperz
    Commented Sep 16, 2011 at 13:43
  • i want to display cut/fill analysis report in html using python/modelbuilder. In report, it inculed volume,area,other formating text.
    – user876307
    Commented Sep 17, 2011 at 6:30

1 Answer 1

2

You can format output as html but there is not enough info in your question to be very specific. Assuming that you writing to an html file:

import sys

htmFile = open("C:\\Dev\\test.html","w")
htmFile.write("""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title></title>
</head>
<body>
""")

string = "my test string for this example"

for s in string:
    htmFile.write( "<p> %s</p>" %s)

htmFile.write("""
</body>
</html>""")

htmFile.close

You will need to replace the content with your analysis and output variables. You can format content using string formatting:

http://docs.python.org/library/stdtypes.html#string-formatting-operations

1
  • 1
    You could just use a template system for Python. Just google templating engines for python. Wiki.python.org has a list. It would make it a little easier, at least I think so.
    – Jamie
    Commented Nov 2, 2011 at 3:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.