open a shell prompt froma python program

Diez B. Roggisch deets at nospam.web.de
Thu Oct 30 06:32:51 EDT 2008


gaurav kashyap wrote:

> On Oct 30, 2:59 pm, Lars Stavholm <st... at telcotec.se> wrote:
>> gaurav kashyap wrote:
>> > Dear all,
>>
>> > Can u tell me a python program that when executed in a shell
>> > prompt,opens another shell prompt.
>>
>> > Simply i want to open a shell prompt from a python program.
>>
>> I think you're looking for:
>>
>> import os
>> os.system("/bin/sh")
> 
> 
> 
> Dear,
> 
> Its not opening a new window,
> I want to do that only from already opened shell prompt window

Then you need to open a terminal, like xterm or konsole. Use
os.system("/usr/bin/konsole") 

Diez



More information about the Python-list mailing list