family
December 22nd, 2007, 09:31 PM
I have a Python script and I need to run a command in the terminal from inside it. For example, how would one os.system("apt-get install sudo") and have a terminal pop-up? Python-apt would be ideal if it worked;
import apt # it is installed, version 0.02
sudo = apt.CacheFile()['sudo']
sudo.markinstall([autoinstall==1])
# nothing works, tried many variations on this, lack of documentation is APPALLING
I have all of the deps for Python-apt too...
Then I tried the vte emulator. No go. Vimsh? No. Commands module? No.
I need my script to be "Run", not "Run in terminal" at startup because mainly 'newbies' will be using it and it has a GUI (which 'clashes' with a terminal according to them).
Please help... I need to have a terminal open up when I issue os.system commands...
import apt # it is installed, version 0.02
sudo = apt.CacheFile()['sudo']
sudo.markinstall([autoinstall==1])
# nothing works, tried many variations on this, lack of documentation is APPALLING
I have all of the deps for Python-apt too...
Then I tried the vte emulator. No go. Vimsh? No. Commands module? No.
I need my script to be "Run", not "Run in terminal" at startup because mainly 'newbies' will be using it and it has a GUI (which 'clashes' with a terminal according to them).
Please help... I need to have a terminal open up when I issue os.system commands...