Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Dennis Lee Bieber Newsgroups: comp.lang.python Subject: Re: Tkinter --> Why multiple windows Date: Fri, 25 Mar 2016 13:03:13 -0400 Organization: IISS Elusive Unicorn Lines: 57 Message-ID: References: <7d191efb-fe80-488f-87db-268b4b893d42@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de aVDAQGv5Ac2MlNmXabbIIACLI3k439qwIBRDtwCebbYg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'essentially': 0.04; 'attributes': 0.07; 'attribute.': 0.09; 'creation,': 0.09; 'message-id:@4ax.com': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Why': 0.09; 'tuple': 0.09; 'assume': 0.11; 'def': 0.13; 'explicitly': 0.15; '2016': 0.16; 'attributes.': 0.16; 'bind': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'subject:Tkinter': 0.16; 'subject:windows': 0.16; 'uname': 0.16; 'url:home': 0.18; 'arguments': 0.22; 'class,': 0.22; 'latter': 0.22; 'visible': 0.22; 'somewhere': 0.24; 'header:X-Complaints-To:1': 0.26; 'fri,': 0.27; 'dictionary': 0.29; "i'm": 0.30; 'print': 0.30; "can't": 0.32; 'skip:_ 10': 0.32; 'class': 0.33; '-0700': 0.33; 'username': 0.33; 'could': 0.35; 'instance': 0.35; 'comment': 0.35; 'to:addr :python-list': 0.36; 'subject:: ': 0.37; 'method': 0.37; 'received:org': 0.37; 'charset:us-ascii': 0.37; 'does': 0.39; 'easily': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'skip:u 10': 0.61; 'entire': 0.61; 'email addr:gmail.com': 0.62; 'show': 0.62; 'further': 0.62; 'necessarily': 0.63; 'mar': 0.65; 'offering': 0.66; 'here': 0.66; 'note:': 0.66; 'useless...': 0.84; 'dennis': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: adsl-108-73-117-233.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:105697 On Fri, 25 Mar 2016 06:41:48 -0700 (PDT), kevind0718@gmail.com declaimed the following: >class Unamepword: > ## > ## class to hold user name and pWord for Database > uName = None > pWord = None Those are essentially useless... > def __init__(self, uStr, pStr): uStr and pStr are required arguments to the instance creation, and > self.uName = uStr > self.pWord = pStr > here you bind them to the instance specific uName/pWord attributes. The class-wide uName/pWord will never be visible unless somewhere you explicitly use Unamepword.uName or Unamepword.pWord in some method of the class, in order to bypass the instance attribute. Since you don't show the entire class I can't comment further -- if all it does is set those attributes you could just as easily use a dictionary login = Unamepword("bob", "secret") print login.uName, login.pWord vs login = { "uName" : "bob", "pWord" : "secret" } print login["uName"], login["pWord"] Note: I'm not necessarily recommending the latter -- just offering alternatives... If you assume username is always first a simple tuple might do login = ("bob", "secret") print login[0], login[1] ... UNAME = 0 PWORD = 1 print login[UNAME], login[PWORD] -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/