I am trying to execute command from python as another "user" with:
command = "sudo su user -c player --standard=1 -o 2"
subprocess.Popen(command.split(), shell=False, stdin=None, stdout=None, stderr=None, close_fds=True)
but everything after -c causes troubles. Any idea how to execute this command with arguments for my program player?
When I create separate 2.py script with "player --standard=1 -o 2" (in subprocess of course) and call this script from my first script via "sudo su user -c /home/user/2.py", it works ok.