我想线程化这个函数,但不知道当 self 参数到位时如何线程化。任何人都知道我该怎么做。我将不胜感激
这是功能
def processinformation(self):
app = App.get_running_app()
session = requests.Session()
self.notif_stream = session.get("**********************************" + app.displayname + "/.json", stream=True)
for line in self.notif_stream.iter_lines():
if line:
print(json.loads(line))
newline = ast.literal_eval(line.decode('utf-8'))
for key, thevalue in newline.items():
for key, value in thevalue.items():
self.notif = session.get("**********************************" + app.displayname + "/" + key + "/" + "notification" + "/.json")
self.notificationslist.adapter.data.extend([value])
青春有我
相关分类