I create 2 streams. In one, the tkinter window is drawn, in the second, asyncio establishes a connection to the server and receives commands from it. The second thread crashes after trying to create
loop = asyncio.get_event_loop() What could be the problem? Client = https://pastebin.com/EEBCfMNq
C:\Users\Aleksey>py D:\Python\Сервер_Proj\new_client.py Exception in thread Thread-2: Traceback (most recent call last): File "C:\Users\Aleksey\AppData\Local\Programs\Python\Python36-32\lib\threading.py", line 916, in _bootstrap_inner self.run() File "C:\Users\Aleksey\AppData\Local\Programs\Python\Python36-32\lib\threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "D:\Python\Сервер_Proj\new_client.py", line 85, in client loop = asyncio.get_event_loop() File "C:\Users\Aleksey\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 678, in get_event_loop return get_event_loop_policy().get_event_loop() File "C:\Users\Aleksey\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 584, in get_event_loop % threading.current_thread().name) RuntimeError: There is no current event loop in thread 'Thread-2'.