Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from wsgiref.simple_server import make_server
- import os
- ...
- ...
- def app(environ, start_response):
- path_info = environ["PATH_INFO"]
- resource = path_info.split("/")[1] #I get no error here the split works totally fine.
- class Myclass:
- def __init__(self, environ, start_response):
- self.environ = environ
- self.start = start_response
- self.status = "200 OK"
- #
- self.headers = []
- #headers = []
- def content_type(path):
- if path.endswith(".css"):
- return "text/css"
- else:
- return "text/html"
- def app(self):
- path_info = self.environ["PATH_INFO"]
- resource = path_info.split("/")[1] # Here now split returns NoneType
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement