On 9 August 2013 23:21, Adam Mercer <ramer...@gmail.com> wrote: > On Thu, Aug 8, 2013 at 11:47 PM, David <bouncingc...@gmail.com> wrote: > >> At a quick glance, I have a couple of suggestions. >> >>> command = ['echo', '-n', channel, '|', 'sudo', 'tee', config_file] >> >> sudo doesn't work like this. It doesn't read from standard input. You >> need to supply the command as an argument to sudo. Get the sudo syntax >> correct by learning to use it in a shell (eg terminal running bash ) >> before trying to use it from python code. > > The above does works in the terminal:
Ah, sorry, I didn't pay close attention to what you are doing (with tee). >> So, if you figure out how to use sudo without '|' you will solve both >> these issues. At least I wasn't 100% wrong :) Anyway I'm glad some smarter people helped you. -- http://mail.python.org/mailman/listinfo/python-list