小编no4*_*syn的帖子

每次我尝试运行app时,"RuntimeError:generator raise StopIteration"

我正在尝试运行此代码:

import web

urls = (
    '/', 'index'
)

if __name__ == "__main__":
    app = web.application(urls, globals())
    app.run()
Run Code Online (Sandbox Code Playgroud)

但它每次都给我这个错误

C:\Users\aidke\Desktop>python app.py
Traceback (most recent call last):
  File "C:\Users\aidke\AppData\Local\Programs\Python\Python37-32\lib\site-packages\web\utils.py", line 526, in take
    yield next(seq)
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "app.py", line 14, in <module>
    app = web.application(urls, globals())
  File "C:\Users\aidke\AppData\Local\Programs\Python\Python37-32\lib\site-packages\web\application.py", line 62, in __init__
    self.init_mapping(mapping)
  File "C:\Users\aidke\AppData\Local\Programs\Python\Python37-32\lib\site-packages\web\application.py", line 130, in init_mapping
    self.mapping = list(utils.group(mapping, 2))
  File "C:\Users\aidke\AppData\Local\Programs\Python\Python37-32\lib\site-packages\web\utils.py", …
Run Code Online (Sandbox Code Playgroud)

python runtime-error helper web stopiteration

32
推荐指数
1
解决办法
2万
查看次数

标签 统计

helper ×1

python ×1

runtime-error ×1

stopiteration ×1

web ×1