Website Design United States, Website Design California, Website Designing United States, Website Designing California

Generating a generic web template - Python

genhtml.py:

Creates a default webpage template
with a css page. You run it like so:

python genhtml.py file.htm styles.css

This generates a default css and xhtml
webpage.
#!/usr/bin/python
import sys
f = file(sys.argv[1], "w")
g = file(sys.argv[2], "w")
text = """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />""" + \
"<link rel=\"stylesheet\" type=\"text/css\" href=\"" + sys.argv[2] + "\" />" + """</head>

<body>
<div id="container">
</div>
</body>

</html>
"""
f.write(text)
g.write("/***** Stylesheet: " + sys.argv[2] + " *****/\n\nbody {\n\t\n\tfont-size: 1em\n}\n\n#container {\n\t\n}\n")


WEB DESIGN INDIA
42 B Malviya Nagar , New Delhi-110017

Skype: manmeetsi
Email: support.webdesignindia@gmail.com
Tel: 91-011-40502005, 9810067295

 















 


© 2008-2009 dotnet4all.com