LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-12-2008, 03:25 AM   #1
athreyavc
Member
 
Registered: May 2004
Location: bangalore
Distribution: Cent OS, Ubuntu
Posts: 116

Rep: Reputation: 15
Creating html pages with python


Hi ,

I am a newbie to python programming. I am trying to generate a script which will telnet a system and bring some details out of it.

I did the telnet part. Now I am trying to convert the output into html page.

the values are assigned to a variabe by the name "output" it is a system configuration output. How can I generate the html page with python.

Please help me on this
 
Old 02-12-2008, 03:37 AM   #2
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
just write html? you know html right?
Code:
.....
html = """
<html>
<body>
%s
</body>
</html>
""" % output
open("htmlfile.html","w").write(html)
.....
 
Old 02-12-2008, 04:58 AM   #3
athreyavc
Member
 
Registered: May 2004
Location: bangalore
Distribution: Cent OS, Ubuntu
Posts: 116

Original Poster
Rep: Reputation: 15
Hi,

Thanks for the reply,

But that is like writing a seperate script, I want to do it within a script.

Thanks and Regards,

Athreya VC
 
Old 02-12-2008, 10:57 PM   #4
athreyavc
Member
 
Registered: May 2004
Location: bangalore
Distribution: Cent OS, Ubuntu
Posts: 116

Original Poster
Rep: Reputation: 15
Hi All,

I am able to do it using html-0.2.1 module available here:
http://home.arcor.de/jurner/python/h.../download.html

It is simple and easy to use html module rather than going for complex ones!

The issue is as for me "CLOSED"

Athreya VC
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML Man Pages bneal Linux - General 9 07-30-2007 12:08 PM
creating HTML pages with mix of English & Arabic rblampain Programming 4 06-03-2007 05:22 PM
HTML pages based on (access) db clpl1980 Fedora 4 01-19-2007 05:31 AM
can't view html pages in IE thisObject Linux - Software 4 05-07-2006 10:55 AM
Cookie Sharing Between CGI generated HTML pages and standard HTML pages rkwhited Linux - Newbie 5 08-15-2004 07:39 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration