Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #10595 > unrolled thread

Re: Windows: setting title of console window

Started byChris Angelico <rosuav@gmail.com>
First post2011-07-30 18:34 +0100
Last post2011-07-30 18:34 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Windows: setting title of console window Chris Angelico <rosuav@gmail.com> - 2011-07-30 18:34 +0100

#10595 — Re: Windows: setting title of console window

FromChris Angelico <rosuav@gmail.com>
Date2011-07-30 18:34 +0100
SubjectRe: Windows: setting title of console window
Message-ID<mailman.1668.1312047290.1164.python-list@python.org>
On Sat, Jul 30, 2011 at 6:23 PM, Ethan Furman <ethan@stoneleaf.us> wrote:
> 8<-- sitecustomize.py ---------------------------------
> class SetTitle(object):
>    def __del__(self):
>        command = ' '.join(sys.argv)
>
> sys.argv = SetTitle()

I'm afraid I don't understand this. Why create an object and do the
work in the destructor? When will the destructor be called? Will you
subsequently be overwriting sys.argv with the actual arguments?

This code snippet makes excellent sense if and only if it's executed
before sys.argv gets set to something meaningful. I'm just not
following how you organize for this to be the case. Is
sitecustomize.py executed before sys.argv is set, and is this affected
by the fact that it actually imports sys?

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web