I'm trying to use Bleak , a Python library for Bluetooth devices management. Starting from an example of use to find active Bluetooth devices
import asyncio
from bleak import BleakScanner
async def main():
devices = await BleakScanner.discover()
for d in devices:
print(d)
asyncio.run(main())
I get a
File "C:\Users\ \Desktop\Python_BLE.py", line 25, in <module>
asyncio.run(main())
File "C:\Users\ \Miniconda3\lib\asyncio\runners.py", line 34, in run
"asyncio.run() cannot be called from a running event loop")
RuntimeError: asyncio.run() cannot be called from a running event loop
I'm running it on Spyder 5.2.2 with Python 3.7.10.