Path: csiph.com!usenet.pasdenom.info!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!news.astraweb.com!border5.newsrouter.astraweb.com!not-for-mail From: "bSneddon" To: All Subject: When do default parameters get their values set? Message-ID: <54866F2E.1765.complang@piz.noip.com> X-Comment-To: All Newsgroups: comp.lang.python X-FTN-AREA: COMP.LANG.PYTHON X-FTN-PID: SoupGate-Win32 v1.05 X-FTN-MSGID: <8c10ecec-c057-4580-9711-94c0a5151646@googlegroups.com> bdfc525e Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: piz.noip.com [Synchronet 3.15b-Win32 NewsLink 1.92] X-Server: piz.noip.me Date: 9 Dec 2014 11:32:01 -0500 Lines: 32 Organization: Unlimited download news at news.astraweb.com NNTP-Posting-Host: 2266ad8f.news.astraweb.com X-Trace: DXC=LP`[=a9Aa>55WGRN4JSiW2L?0kYOcDh@:RScV177L_P1Zh[e@ZS;QS3l23]GVn`Zm6MHo6fPSBkU;04hIVDTD?[;7g\XjYcGeh9fPiGS6_2a\= Xref: csiph.com comp.lang.python:82227 I ran into an issue setting variables from a GUI module that imports a back end module. My approach was wrong obviously but what is the best way to set values in a back end module. #module name beTest.py cfg = { 'def' : 'blue'} def printDef(argT = cfg['def']): print argT #module name feTest import beTest beTest.cfg['def'] = "no red" beTest.printDef() This prints blue. I suppose because I am changing a local copy of cfg dictionary. What is the write approach here? Thanks Bill --- SoupGate-Win32 v1.05 * Origin: NNTP.gateway.@.piz.noip.me> (1:249/999) --- Synchronet 3.15b-Win32 NewsLink 1.92 SpaceSST BBS Usenet <> Fidonet Gateway