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


Groups > comp.lang.python > #7433

(*args **kwargs) how do I use' em?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail
From TheSaint <nobody@nowhere.net.no>
Newsgroups comp.lang.python
Subject (*args **kwargs) how do I use' em?
Followup-To comp.lang.python
Date Sat, 11 Jun 2011 13:01:36 +0800
Organization Aioe.org NNTP Server
Lines 47
Message-ID <isusrj$kbs$1@speranza.aioe.org> (permalink)
NNTP-Posting-Host Bb0fKNor7NvANGPrvKEVkg.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Complaints-To abuse@aioe.org
User-Agent KNode/4.4.11
X-Notice Filtered by postfilter v. 0.8.2
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:7433

Followups directed to: comp.lang.python

Show key headers only | View raw


Hello,
I'm seldomly writng python code, nothing but a beginner code.

I wrote these lines >>

=============================================================
_log_in= mhandler.ConnectHandler(lmbox, _logger, accs)
multhr= sttng['multithread']
if multhr:
    _log_in= mhandler.mThreadSession(lmbox, _logger, accs)

for svr in servrs:
    nmsvr, user, pwd, ptcl = servrs[svr]
    al, dn= sttng['Cfilter']; er= sttng['filter']
    try:
         rx.append( _log_in.connect((nmsvr, user, pwd, ptcl, (al, dn, er))))
    except ProtocolError:
         print(svr+ errors['SerProb'])
    except KeyboardInterrupt:
        raise SystemExit(errors['YouStop'])
if multhr:
    for s in rx:
        try: s.start()
        except (ProtocolError, AttributeError):
            print(svr+ errors['SerProb'])
        except KeyboardInterrupt:
            raise SystemExit(errors['YouStop'])
    for s in rx:
        try: s.join() # waiting all threads to finish
        except (ProtocolError, AttributeError):
            print(svr+ errors['SerProb'])
        except KeyboardInterrupt:
            raise SystemExit(errors['YouStop'])

=============================================================

Surely ugly and I believe that would be a better way to pass the arguments 
as I mention on the subject.
Then it should give a dictionary of keywords and some function or a 
callable. I don't know how to put down these code lines.
I think I should restructure many points of my data.

Any suggestion will make me happier :)


-- 
goto /dev/null

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

(*args **kwargs) how do I use' em? TheSaint <nobody@nowhere.net.no> - 2011-06-11 13:01 +0800
  Re: (*args **kwargs) how do I use' em? OliDa <olivier.darge@gmail.com> - 2011-06-11 01:20 -0700
    Re: (*args **kwargs) how do I use' em? TheSaint <nobody@nowhere.net.no> - 2011-06-11 19:32 +0800

csiph-web