【发布时间】:2019-04-19 21:15:26
【问题描述】:
您好,我正在尝试运行this tutorial,但在 Python 3 中,所以我在此行中有此 ValueError(解包的值太多(预期为 3)),在图片中以蓝色标记或如下所示:
def parse_request(self, text):
request_line = text.splitlines()[0]
request_line = request_line.rstrip('\r\n')
# Break down the request line into components
(self.request_method, # GET
self.path, # /hello
self.request_version # HTTP/1.1
) = request_line.split()
我不知道我做错了什么。有人可以帮帮我吗?提示中的代码没问题,但是当我在 Google Chrome 中打开 localhost:8888/hello 时,它会在 Anaconda 提示中返回此错误。我正在使用 Sublime Text 来运行它。我试图用 Jupyter 来做,但它给了我另一个错误。我不知道该怎么办。感谢您的回复。
【问题讨论】: