Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

i want to create Analysis report after createing model for generating cut/fill. Once it will done , basedon this cutfill/table, would be display statics in html formate using python. is it possible. pl. tell me how it will done.

Thanks

share|improve this question
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 Sep 16 '11 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 Sep 17 '11 at 6:30
add comment

1 Answer

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

share|improve this answer
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 Nov 2 '11 at 3:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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