ubuntu - Python sudo in new terminal window without passing password -


i have problem. i'm trying run sudo command in new terminal window python script every time have put password in new window. here code:

import subprocess import sys import os def run_lirc():     subprocess.call(['x-terminal-emulator','-e','sudo lircd']) run_lirc() 

is solution allow me not pass root password? have open lirc in new terminal window.

apart calling subcommand in "terminal window" being bad idea, issue sudo configuration.

sudo assigns tty cookies sessions, limiting session timeout tty got authentication.

you can prevent happening disabling tty_tickets option in /etc/sudoers:

defaults !tty_tickets 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -