Python Forum
can I use 2 child.expect at the same time?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
can I use 2 child.expect at the same time?
#1
Hello
I'm running a code that scan bluetooth
I have notice that some time the reaply is wil rssi and sometime he print the name of the devcie
this is the cmd replay:
@raspberrypi:~ $ bluetoothctl 
Agent registered
[bluetooth]# scan on
Discovery started
[CHG] Controller DC:A6:32:75:55:C5 Discovering: yes
[NEW] Device EB:8E:13:4C:E0:AC MDBT42Q e0ac
[NEW] Device E9:EB:1B:66:08:1F MDBT42Q 081f
[NEW] Device A8:9C:ED:2A:9C:30 wallie
[CHG] Device EB:8E:13:4C:E0:AC RSSI: -70


in my code I use this regex
i = child.expect("Device (([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})) RSSI: (-[0-9]{2})", timeout=10)
is there any what to create antoher child.expect on the same answer?
so I will also can read the name ?

Thanks ,
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Using one child class method in another child class garynewport 5 1,484 Jan-11-2023, 06:07 PM
Last Post: garynewport
  Not able to read the text using pexpect/expect Bipinjohnson 7 3,940 Jan-10-2022, 11:21 AM
Last Post: Bipinjohnson
  Please help me. about self.expect() leeyoung 0 1,281 Nov-23-2020, 10:25 PM
Last Post: leeyoung
  Trying to convert my Expect/bash to Python sumncguy 4 3,986 Jun-07-2019, 07:14 AM
Last Post: DeaD_EyE
  XML Parsing Child karthi_python 1 1,853 May-16-2019, 01:37 PM
Last Post: karthi_python
  parent/add and child/div PyMan 1 2,383 Feb-23-2018, 04:38 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020