我有这个代码。
scrcpy_subprocess = subprocess.Popen([scrcpy_executable, '--serial', device_selection['devices']], stdin=None, stdout=console_log, stderr=console_log)
这一节
device_selection['devices']
当程序运行时。存储在上述变量中的变量仍然包含引号。
这意味着它的结果是这样的..
error: failed to get feature set: device 'AQYHCE9L5LH6EMDY
' not found
有人知道解决这个问题的方法吗?
发布于 2020-09-18 18:28:19
基于这个错误,它看起来更像是在其中包含换行符,而不是引号。
试一试
device = device_selection["devices"].strip() # remove trailing/leading spaces
scrcpy_subprocess = subprocess.Popen(
[scrcpy_executable, "--serial", device],
stdin=None,
stdout=console_log,
stderr=console_log,
)
或者如果它还是不起作用,
# remove trailing/leading spaces, then all quotes
device = device_selection["devices"].strip().replace("'", "")
https://stackoverflow.com/questions/63953948
复制相似问题