[Tutor] Opening a cmd.exe

Alan Gauld alan.gauld at btinternet.com
Sun Mar 22 15:31:04 CET 2009


"Sigga Sig" <sigridurs07 at ru.is> wrote

> I am writing a code that is supoesed to act as routers and i need to 
> open a
> different cmd window for each one of them with it's name and so on. 
> I do not
> know how to implement in mi Python cod a sentece that opens such a 
> cmd.
>
> I know how to open a cmd.exe bud not with specific attributes that 
> are
> needed.

Neither do I. You can use shortcuts and set the name of the shortcut
and that will show up on the window title.

There are probably ways to do it using the Win32 API too, but you 
would
need to get the Window Handle using FindWindow(). And I'm still not 
sure
which API call would set the title. I'd probably just create a set of
shortfcuts on a folder and execute those.

HTH,

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/





More information about the Tutor mailing list