When I use
sudo -u tango crontab -l >> /tmp/crontango.txt
within the terminal it works fine.
Doing the following in python
import subprocess
subprocess.run(['sudo', '-u tango', 'crontab', '-l', '>>', '/tmp/crontango.txt'])
leads to an error
sudo: unknown user: tango
I tried to reconfigure the arguments without any success.
How do I copy my crontab to a textfile using a python script?