Code: Alles auswählen
#!/usr/bin/env python
#-*- coding:utf-8 -*-
def print_header():
print """Content-Type: text/html
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>test2</title>
</head>
<body>
<h1>test</h1>"""
################################################################################
def print_footer():
print "</body>\n</html>"
if __name__ == '__main__':
print_header()
print_footer()
und beim ausführen bekomme ich folgendes raus
hierbei handelt es sich jetzt nicht um ein Python Code
sondern das was beim ausführen im Browser auftaucht
Code: Alles auswählen
#!/usr/bin/env python #-*- coding:utf-8 -*- def print_header(): print """Content-Type: text/html
Lager
""" ################################################################################ def print_footer(): print "\n" if __name__ == '__main__': print_header() print_footer()
Mfg
zahi