Alle Dateien aus dem Pythonkurs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

32 lines
914 B

#! /usr/bin/python3
from http.server import BaseHTTPRequestHandler,HTTPServer
import logging
logging.basicConfig( format='%(asctime)-15s [%(levelname)s] %(funcName)s: %(message)s', filename='ledserver.log', level=logging.DEBUG)
class http_server:
def __init__(self):
def handler(*args):
myHandler(*args)
server = HTTPServer(('', 8080), handler)
class myHandler(BaseHTTPRequestHandler):
def __init__(self,*args):
self.t1 = t1
BaseHTTPRequestHandler.__init__(self, *args)
def do_GET(self):
logging.debug('GET: empfangen')
self.send_response(200)
self.send_header('Content-type','text/html')
self.end_headers()
self.wfile.write(self.t1.show()) #Doesnt work
return
class main:
def __init__(self):
self.server = http_server()
if __name__ == '__main__':
logging.debug('MAIN: start')
main()