I want to get output of this shell command using Python:
loginctl show-session -p Display -p Active c2
Output is:
Display=:0
Active=yes
In Python, I do it this way:
import subprocess
subprocess.call(['loginctl', 'show-session -p Display -p Active c2'])
I get this error:
Unknown operation show-session -p Display -p Active c2
What could be cause?