Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'imports': 0.07; 'snippet': 0.07; 'executed': 0.09; 'subject:setting': 0.09; 'wrote:': 0.15; 'destructor': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'overwriting': 0.16; 'set,': 0.16; '\xa0def': 0.16; 'case.': 0.16; 'pm,': 0.16; 'organize': 0.19; 'received:74.125.82.174': 0.19; 'received:mail- wy0-f174.google.com': 0.19; 'subject:Windows': 0.19; 'header:In- Reply-To:1': 0.22; 'subsequently': 0.23; 'code': 0.24; "i'm": 0.27; 'sat,': 0.28; 'message-id:@mail.gmail.com': 0.28; 'affected': 0.29; 'object': 0.30; 'fact': 0.30; 'class': 0.31; 'this.': 0.31; "skip:' 10": 0.32; 'actually': 0.33; 'to:addr :python-list': 0.34; 'actual': 0.35; 'received:google.com': 0.38; 'subject:: ': 0.38; 'something': 0.38; 'received:74.125.82': 0.39; 'to:addr:python.org': 0.39; 'received:74.125': 0.40; 'sense': 0.40; 'afraid': 0.68; '30,': 0.74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=GLMA7lkKLSFXlj8luUZ1klSpDVaMsfdIjiejEmU9Yw8=; b=jEv6B0x9/+WqawcfivrIcfQnblnmNUoTQNR88bur7glRZCW5uwRjl7LJ0dkFd+WCkC gPXhe1iHD00XtjBEanSbowebWINGdrjdWAWzA14K4QXfT+iuU7Hjioov7AG9RiASQ3nf tp+si0XsLqwePlHEzU+7KO1RdLDlgYStPCcxU= MIME-Version: 1.0 In-Reply-To: <4E343E1C.90807@stoneleaf.us> References: <4E343E1C.90807@stoneleaf.us> Date: Sat, 30 Jul 2011 18:34:48 +0100 Subject: Re: Windows: setting title of console window From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1312047290 news.xs4all.nl 23946 [2001:888:2000:d::a6]:50357 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:10595 On Sat, Jul 30, 2011 at 6:23 PM, Ethan Furman wrote: > 8<-- sitecustomize.py --------------------------------- > class SetTitle(object): > =A0 =A0def __del__(self): > =A0 =A0 =A0 =A0command =3D ' '.join(sys.argv) > > sys.argv =3D 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