Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 龙卷风应用在分层后结束_Python_Tornado - Fatal编程技术网

Python 龙卷风应用在分层后结束

Python 龙卷风应用在分层后结束,python,tornado,Python,Tornado,我想启动我的tornado hello world应用程序。我从tornado网站复制了以下代码: import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello, world") application = tornado.web.Application([ (r"/", MainH

我想启动我的tornado hello world应用程序。我从tornado网站复制了以下代码:

import tornado.ioloop
import tornado.web

class MainHandler(tornado.web.RequestHandler):
    def get(self):
        self.write("Hello, world")

application = tornado.web.Application([
    (r"/", MainHandler),
])

if __name__ == "__main__":
    application.listen(8888)
    tornado.ioloop.IOLoop.instance().start()
当我尝试在pycharm中运行它时,会显示一条消息:

Process finished with exit code 0

有什么问题吗?

可能的重复:在PyCharm中对我有效:进程运行直到我杀死它。我可以访问
localhost:8888
并查看“你好,世界”。你确定你在PyCharm中运行的是正确的脚本吗?或者除了这里显示的脚本之外,你还在运行其他脚本吗?如果你只是在一个简单的双clic(在windows上)上运行代码,或者在linux上的shell(python example.py)上运行代码,它会给你带来什么?你是在运行这个模块,而不是在附近的项目中运行一些陈旧的配置吗?