python get the phone number of the device

The Code
1  # # multiple devices acquiring device list No. 
2  DEF get_deviceid ():
 . 3      str_init = '  ' 
. 4      all_info = os.popen, ( ' adb devices ' ) .readlines ()
 . 5      Print ( ' content output adb devices are: ' , all_info)
 . 6  
. 7      for I in Range (len (all_info)):
 . 8          str_init + = all_info [I]
 . 9      Devices_NAME the re.findall = ( ' .? \ n-(+) \ T ' , str_init, re.S)
 10  
. 11      Print ( 'All names: \ n- ' , Devices_NAME)
 12 is      return Devices_NAME
 13 is  
14 R & lt = get_deviceid ()
 15  Print (R & lt)
 

 

Guess you like

Origin www.cnblogs.com/lisa2016/p/11209106.html