<div>
<div>
<span>
A good tutorial will surely help : <a href="http://www.saltycrane.com/blog/2008/01/how-to-use-args-and-kwargs-in-python/" style="color: rgb(0, 58, 138); ">http://www.saltycrane.com/blog/2008/01/how-to-use-args-and-kwargs-in-python/</a><br><br>The idea between *args and *kwargs is to create function (callables) which accepts an arbitrary number of anonymous and/or keyword arguments.<br><br>It's useful when you want to create a function that will call an another one (inheritances or decorators).<br><br>Hope this helps,</span><span><br>-- <br>Envoyé avec <a href="http://www.sparrowmailapp.com/?sig">Sparrow</a><br></span>
<p style="color: #a0a0a0;">Le samedi 11 juin 2011 à 07:01, TheSaint a écrit :</p>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
<span><div><div>Hello,<br>I'm seldomly writng python code, nothing but a beginner code.<br><br>I wrote these lines >><br><br>=============================================================<br>_log_in= mhandler.ConnectHandler(lmbox, _logger, accs)<br>multhr= sttng['multithread']<br>if multhr:<br> _log_in= mhandler.mThreadSession(lmbox, _logger, accs)<br><br>for svr in servrs:<br> nmsvr, user, pwd, ptcl = servrs[svr]<br> al, dn= sttng['Cfilter']; er= sttng['filter']<br> try:<br> rx.append( _log_in.connect((nmsvr, user, pwd, ptcl, (al, dn, er))))<br> except ProtocolError:<br> print(svr+ errors['SerProb'])<br> except KeyboardInterrupt:<br> raise SystemExit(errors['YouStop'])<br>if multhr:<br> for s in rx:<br> try: s.start()<br> except (ProtocolError, AttributeError):<br> print(svr+ errors['SerProb'])<br> except KeyboardInterrupt:<br> raise SystemExit(errors['YouStop'])<br> for s in rx:<br> try: s.join() # waiting all threads to finish<br> except (ProtocolError, AttributeError):<br> print(svr+ errors['SerProb'])<br> except KeyboardInterrupt:<br> raise SystemExit(errors['YouStop'])<br><br>=============================================================<br><br>Surely ugly and I believe that would be a better way to pass the arguments <br>as I mention on the subject.<br>Then it should give a dictionary of keywords and some function or a <br>callable. I don't know how to put down these code lines.<br>I think I should restructure many points of my data.<br><br>Any suggestion will make me happier :)<br><br><br>-- <br>goto /dev/null<br>-- <br><a href="http://mail.python.org/mailman/listinfo/python-list">http://mail.python.org/mailman/listinfo/python-list</a><br></div></div></span>
</blockquote>
<div>
<br>
</div>
</div>
</div>