Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. from wsgiref.simple_server import make_server
  2. import os
  3. ...
  4. ...
  5. def app(environ, start_response):
  6. path_info = environ["PATH_INFO"]
  7. resource = path_info.split("/")[1] #I get no error here the split works totally fine.
  8.  
  9. class Myclass:
  10.  
  11.  
  12. def __init__(self, environ, start_response):
  13. self.environ = environ
  14. self.start = start_response
  15. self.status = "200 OK"
  16. #
  17. self.headers = []
  18.  
  19. #headers = []
  20. def content_type(path):
  21. if path.endswith(".css"):
  22. return "text/css"
  23. else:
  24. return "text/html"
  25.  
  26.  
  27. def app(self):
  28. path_info = self.environ["PATH_INFO"]
  29. resource = path_info.split("/")[1] # Here now split returns NoneType
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement