Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
you can give the superuser attribute directly to shutdown itself
(done once)
sudo chmod +s `which shutdown`
and then, without superuser rights, call shutdown -h now from pearl
docs.python.org/library/subprocess.html
www.linux.org.ru/forum/development/6305431
$ python
Python 2.7.1 (r271:86832, Apr 23 2011, 22:48:40)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from subprocess import Popen, PIPE
>>> Popen("ls -1", shell=True, stdin=PIPE, stdout=PIPE).stdout.read().split()
['1', '111', '222', '333', 'Downloads', 'John', 'Crawford', '(musician)', '-', 'Wikipedia,', 'the', 'free', 'encyclopedia_files', 'John', 'Crawford', '(musician)', '-', 'Wikipedia,', 'the', 'free', 'encyclopedia.html', 'nohup.out', 'Usage', 'xlog']
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question