A certainl part of an if() structure never gets executed.

Thomas Rachel nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915 at spamschutz.glglgl.de
Wed Jun 26 05:07:48 EDT 2013


Am 12.06.2013 03:46 schrieb Rick Johnson:
> On Tuesday, June 11, 2013 8:25:30 PM UTC-5, nagia.... at gmail.com wrote:
>
>> is there a shorter and more clear way to write this?
>> i didnt understood what Rick trie to told me.
>
> My example included verbatim copies of interactive sessions within the Python command line. You might understand them better if you open the Python command line and type each command in one-by-one. Here is an algoritm that explains the process:
>
> open_command_window()
> whilst learning or debugging:
>      type_command()
>      press_enter()
>      observe_output()
>      if self.badder.is_full:
>          take_potty_break()
> close_command_window()

with command_window():
    whilst learning or debugging:
       type_command()
       press_enter()
       observe_output()
       if self.badder.is_full:
           take_potty_break()

looks nicer.

SCNR


Thomas



More information about the Python-list mailing list