by Anonymous » 02 Mar 2025, 13:41
Im folgenden Python -Code wird die Zeile von pygrabber.dshow_graph import filtergraph enthalten bestimmt, ob ein Fehler auftritt. Wenn ich es nicht einfüge, wird kein Fehler angezeigt, aber wenn ich es einbeziehe, ist der Fehler "Geräte -Suchfehler: Thread für Windows -GUI konfiguriert, aber Rückrufe funktionieren nicht." tritt auf. Es scheint, dass Pygrabber und trostlos widersprüchlich sind und den Fehler verursachen. Ich brauche beide Bibliotheken. Was soll ich tun? < /P>
Code: Select all
# -*- coding: utf-8 -*-
import multiprocessing
import asyncio
from bleak import BleakScanner
#This is the cause of the error.
from pygrabber.dshow_graph import FilterGraph
async def bluetooth_receiver_start():
print("bluetooth_receiver_start")
try:
devices = await BleakScanner.discover()
print("scnanned devices:")
for device in devices:
print(f" - {device.name} ({device.address})")
except Exception as e:
print(f"device search error: {e}")
return
def bluetooth_process():
print("bluetooth_process started")
asyncio.run(bluetooth_receiver_start())
print("bluetooth_process finished")
if __name__ == '__main__':
process_bluetooth = multiprocessing.Process(target=bluetooth_process)
process_bluetooth.start()
try:
devices = FilterGraph().get_input_devices()
for device_index, device_name in enumerate(devices):
print(device_name)
except:
pass
Im folgenden Python -Code wird die Zeile von pygrabber.dshow_graph import filtergraph enthalten bestimmt, ob ein Fehler auftritt. Wenn ich es nicht einfüge, wird kein Fehler angezeigt, aber wenn ich es einbeziehe, ist der Fehler "Geräte -Suchfehler: Thread für Windows -GUI konfiguriert, aber Rückrufe funktionieren nicht." tritt auf. Es scheint, dass Pygrabber und trostlos widersprüchlich sind und den Fehler verursachen. Ich brauche beide Bibliotheken. Was soll ich tun? < /P>
[code]# -*- coding: utf-8 -*-
import multiprocessing
import asyncio
from bleak import BleakScanner
#This is the cause of the error.
from pygrabber.dshow_graph import FilterGraph
async def bluetooth_receiver_start():
print("bluetooth_receiver_start")
try:
devices = await BleakScanner.discover()
print("scnanned devices:")
for device in devices:
print(f" - {device.name} ({device.address})")
except Exception as e:
print(f"device search error: {e}")
return
def bluetooth_process():
print("bluetooth_process started")
asyncio.run(bluetooth_receiver_start())
print("bluetooth_process finished")
if __name__ == '__main__':
process_bluetooth = multiprocessing.Process(target=bluetooth_process)
process_bluetooth.start()
try:
devices = FilterGraph().get_input_devices()
for device_index, device_name in enumerate(devices):
print(device_name)
except:
pass
[/code]