If I run system_profiler SPDisplaysDataType | grep Resolution
in terminal, I get my resolution. I was trying to do this with subprocess.run, but I didn't know how to configure the arguments and I tried many variations. My code is like this:
res = subprocess.run(["system_profiler", "SPDisplaysDataType", "|", "grep", "Resolution"], capture_output=True)
but this is running the same as system_profiler SPDisplaysDataType
, the | grep Resolution
isn't working. Does anyone know how to fix this?