Setting win32 console title from Python



Hi,
I'm trying to set the title of the console window (CMD.EXE) in Windows.
I want it set to the basename of the current directory and it should
stay after the script has finished.

Now, the console title is easily set with the DOS-command 'title
NewTitle'. But I'd like to do this from a Python script.

os.system('title NewTitle') will not do, because it spawns a new
process.

win32api.SetConsoleTitle('NewTitle') will not do either, because the
NewTitle is reset as soon as the script finishes.

Chris Gonnerman's WConio
<http://newcenturycomputers.net/projects/wconio.html>
has a settitle() method and
WConio.settitle("NewTitle") does what I want, but not under CMD.EXE,
only COMMAND.EXE.

Any ideas?

.



Relevant Pages

  • Re: Im sure this is a silly question
    ... > When this app is started a console window appears, ... > is closed the app stops. ... > application and does not bind it to your script; ... Find local movie times and trailers on Yahoo! ...
    (Fedora)
  • RE: Im sure this is a silly question
    ... > When this app is started a console window appears, ... > is closed the app stops. ... > application and does not bind it to your script; ... > Jeff Birt ...
    (Fedora)
  • Re: MacTel: Disabling The Console Window
    ... What version of Tcl are you using? ... my problems are related to the console window because the menu bar is ... your script. ... Tcl_Init and initialize Tk by calling Tk_Init. ...
    (comp.lang.tcl)
  • Re: MacTel: Disabling The Console Window
    ... my problems are related to the console window because the menu bar is ... your script. ... One of the first things my C code does is initialize Tcl by calling ... Tcl_Init and initialize Tk by calling Tk_Init. ...
    (comp.lang.tcl)
  • Im sure this is a silly question
    ... I have an application that is started by a script in .kde/Autostart. ... When this app is started a console window appears, ... when you launch it manually from a console window) (BTW, ...
    (Fedora)