#python #anaconda #jupyter-notebook #visual-code #html #css #javascript #http 제목웹파이썬프로그래밍 웹 관련 질문입니다!2023-06-05 02:23작성자WEBEB안녕하세요, 웹파이썬프로그래밍 강의자료를 보던 중 궁금한 점이 있어 질문글 올립니다.httpserver3 자료 관련 질문입니다.전체 코드가 아래와 같은데, form이라는 객체는 form['food'][0]와 같이 쓰이는 것을 보니 리스트와 비슷한 형태인 것 같은데 왜 [] 안에 문자열인 'food'가 들어가게 되는지 모르겠습니다. html과 javascript에서 name이 food로 되어 있기 때문에 이렇게 되는 것인가요?class testHTTPServer_RequestHandler(SimpleHTTPRequestHandler): def do_GET(self): url = self.path form = parse_qs(urlparse(url).query) if (form != {}): self.process_form(form) super().do_GET() print("do_get") def process_form(self,form): if 'food' in form: if form['food'][0] == 'Pizza': print(form['firstname'][0] + ", call Dominos tonight!") elif form['food'][0] == 'Tacos': print(form['firstname'][0] + ", go to TacoBell tonight!") elif form['food'][0] == 'Salad': print(form['firstname'][0] + ", have a Caesar Salad tonight!")port = 9095 httpd = HTTPServer(('', port), testHTTPServer_RequestHandler)print("Starting simple_httpd on port: " + str(httpd.server_port))httpd.serve_forever() 목록수정삭제답변글쓰기 댓글 [0] 댓글작성자(*)비밀번호(*)내용(*) 댓글 등록 더보기이전텀프 제출문의수강생2023-06-05다음[공지] SWCON104-02 온라인 수업 기말고사drsungwon 2023-05-29 Powered by MangBoard | 워드프레스 쇼핑몰 망보드