Python程序停止,但PID仍处于活动状态
我的程序在大约6小时后停止工作,但Python程序停止,但PID仍处于活动状态,python,exit,pid,python-asyncio,autobahn,Python,Exit,Pid,Python Asyncio,Autobahn,我的程序在大约6小时后停止工作,但PID仍处于活动状态。当我使用single_process模块,然后再次尝试启动程序时,还会告诉我终端输出: There is an instance of programm.py running. Quit 我的程序代码很简单,只是从聊天室读取输出,但我不知道为什么它在6小时后停止工作。有人能帮忙吗 from autobahn.asyncio.wamp import ApplicationSession from autobahn.asyncio.wamp
PID
仍处于活动状态。当我使用single_process
模块,然后再次尝试启动程序时,还会告诉我终端输出:
There is an instance of programm.py running. Quit
我的程序代码很简单,只是从聊天室读取输出,但我不知道为什么它在6小时后停止工作。有人能帮忙吗
from autobahn.asyncio.wamp import ApplicationSession
from autobahn.asyncio.wamp import ApplicationRunner
from asyncio import coroutine
from datetime import datetime
from single_process import single_process
class PoloniexComponent(ApplicationSession):
def onConnect(self):
self.join(self.config.realm)
@coroutine
def onJoin(self, details):
def onTrollbox(*args):
print("type: ", args[0])
print("msg_number: ", args[1])
print("user_name: ", args[2])
print("message: ", args[3])
print("reputation: ", args[4])
print(datetime.utcnow())
try:
yield from self.subscribe(onTrollbox, 'trollbox')
except Exception as e:
print("Could not subscribe to topic:", e)
@single_process
def main():
runner = ApplicationRunner("wss://api.poloniex.com", "realm1")
runner.run(PoloniexComponent)
if __name__ == "__main__":
main()
您是否保存了任何输出?特别是,查找
无法订阅主题:
行。我没有输出,但PID仍然处于活动状态。是否有可能在文件处于活动状态时将所有内容输出到文件中?是否保存了任何输出?特别是,查找无法订阅主题:
行。我没有输出,但PID仍然处于活动状态。是否有可能在文件处于活动状态时将所有内容输出到文件中?