Hey all.
I am working on a little project in python. i have produced this prototype
Code:
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
#DocC documentation prototype
sitestructure = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title></title><style type="text/css">pre {background-color: #DDFFDD;border: solid 1px #BBDDBB;padding: 10px;}.notice {background-color: #DDDDFF;border: solid 1px #BBBBFF;}b {font-size: 0.8em;}</style></head><body><h1>Documentation</h1>'
userinput = raw_input("Please specify file path: ")
input = file(userinput, "r")
source_code = input.read()
source_code = source_code.replace("<","<")
source_code = source_code.replace(">",">")
userinput = userinput + ".html"
sitecontent = sitestructure + "<pre>" + source_code + "</pre>" + "</body></html>"
sample_file = file(userinput, "w")
sample_file.write(sitecontent)
raw_input("Pause")
Its producing a blank file. no error messages or nothing. whats wrong ?
/mads