Windows: setting title of console window

Thomas Jollans t at jollybox.de
Sat Jul 30 19:16:08 EDT 2011


On 30/07/11 20:39, Ethan Furman wrote:
> How it works: since the sys.argv object does yet exist, I create an
> object and assign it to sys.argv; then, when Python assigns the actual
> argv to sys.argv, my object is tossed, and the __del__ method is called;
> the __del__ method is then able to access the real argv and set the
> title bar accordingly. I put the sleep in just to avoid any possible
> race conditions, but I'm not sure it's necessary. If you don't want to
> see all the command-line args, you can pre-process command any way you
> like.

Why though? Can't you just call SetConsoleTitle immediately?



More information about the Python-list mailing list