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


Groups > comp.lang.python > #47701 > unrolled thread

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

Started byΝικόλαος Κούρας <nikos.gr33k@gmail.com>
First post2013-06-11 13:20 -0700
Last post2013-06-14 15:31 +0300
Articles 20 on this page of 171 — 44 participants

Back to article view | Back to comp.lang.python


Contents

  A certainl part of an if() structure never gets executed. Νικόλαος Κούρας <nikos.gr33k@gmail.com> - 2013-06-11 13:20 -0700
    Re: A certainl part of an if() structure never gets executed. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-11 23:14 +0100
    Re: A certainl part of an if() structure never gets executed. MRAB <python@mrabarnett.plus.com> - 2013-06-11 23:43 +0100
      Re: A certainl part of an if() structure never gets executed. nagia.retsina@gmail.com - 2013-06-11 18:25 -0700
        Re: A certainl part of an if() structure never gets executed. Rick Johnson <rantingrickjohnson@gmail.com> - 2013-06-11 18:46 -0700
          Re: A certainl part of an if() structure never gets executed. alex23 <wuwei23@gmail.com> - 2013-06-11 18:57 -0700
            Re: A certainl part of an if() structure never gets executed. Chris Angelico <rosuav@gmail.com> - 2013-06-12 12:05 +1000
              Re: A certainl part of an if() structure never gets executed. alex23 <wuwei23@gmail.com> - 2013-06-11 19:14 -0700
                Re: A certainl part of an if() structure never gets executed. Rick Johnson <rantingrickjohnson@gmail.com> - 2013-06-11 20:37 -0700
                  Re: A certainl part of an if() structure never gets executed. Rick Johnson <rantingrickjohnson@gmail.com> - 2013-06-11 20:50 -0700
          Re: A certainl part of an if() structure never gets executed. Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2013-06-26 11:07 +0200
        Re: A certainl part of an if() structure never gets executed. MRAB <python@mrabarnett.plus.com> - 2013-06-12 02:50 +0100
        Re: A certainl part of an if() structure never gets executed. Cameron Simpson <cs@zip.com.au> - 2013-06-12 12:00 +1000
    Re: A certainl part of an if() structure never gets executed. Rick Johnson <rantingrickjohnson@gmail.com> - 2013-06-11 15:48 -0700
    Re: A certainl part of an if() structure never gets executed. alex23 <wuwei23@gmail.com> - 2013-06-11 16:45 -0700
    Re: A certainl part of an if() structure never gets executed. Michael Torrie <torriem@gmail.com> - 2013-06-11 22:49 -0600
      Re: A certainl part of an if() structure never gets executed. Νικόλαος Κούρας <support@superhost.gr> - 2013-06-12 07:45 +0000
        Re: A certainl part of an if() structure never gets executed. Chris Angelico <rosuav@gmail.com> - 2013-06-12 17:55 +1000
          Re: A certainl part of an if() structure never gets executed. Neil Cerutti <neilc@norwich.edu> - 2013-06-12 13:05 +0000
            Re: A certainl part of an if() structure never gets executed. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-12 15:37 +0100
    Re: A certainl part of an if() structure never gets executed. Michael Torrie <torriem@gmail.com> - 2013-06-11 23:05 -0600
    Re: A certainl part of an if() structure never gets executed. Tim Roberts <timr@probo.com> - 2013-06-11 22:44 -0700
      Re: A certainl part of an if() structure never gets executed. alex23 <wuwei23@gmail.com> - 2013-06-11 23:16 -0700
      Re: A certainl part of an if() structure never gets executed. Grant Edwards <invalid@invalid.invalid> - 2013-06-12 14:38 +0000
        Re: A certainl part of an if() structure never gets executed. Neil Cerutti <neilc@norwich.edu> - 2013-06-12 14:55 +0000
          Re: A certainl part of an if() structure never gets executed. Zero Piraeus <schesis@gmail.com> - 2013-06-12 11:20 -0400
            Re: A certainl part of an if() structure never gets executed. rusi <rustompmody@gmail.com> - 2013-06-13 05:30 -0700
              Re: A certainl part of an if() structure never gets executed. Roy Smith <roy@panix.com> - 2013-06-13 09:01 -0400
            Re: A certainl part of an if() structure never gets executed. Neil Cerutti <neilc@norwich.edu> - 2013-06-13 12:34 +0000
              Re: A certainl part of an if() structure never gets executed. Νικόλαος Κούρας <support@superhost.gr> - 2013-06-13 20:00 +0300
                Re: A certainl part of an if() structure never gets executed. Jan Riechers <janpeterr@freenet.de> - 2013-06-19 01:05 +0300
    Re: A certainl part of an if() structure never gets executed. Denis McMahon <denismfmcmahon@gmail.com> - 2013-06-12 08:27 +0000
      Re: A certainl part of an if() structure never gets executed. Νικόλαος Κούρας <support@superhost.gr> - 2013-06-12 11:54 +0300
        Re: A certainl part of an if() structure never gets executed. Fábio Santos <fabiosantosart@gmail.com> - 2013-06-12 10:07 +0100
          Re: A certainl part of an if() structure never gets executed. Νικόλαος Κούρας <support@superhost.gr> - 2013-06-12 12:19 +0300
            Re: A certainl part of an if() structure never gets executed. Fábio Santos <fabiosantosart@gmail.com> - 2013-06-12 10:57 +0100
          Re: A certainl part of an if() structure never gets executed. Νικόλαος Κούρας <support@superhost.gr> - 2013-06-12 13:45 +0300
        Re: A certainl part of an if() structure never gets executed. Andreas Perstinger <andipersti@gmail.com> - 2013-06-12 12:07 +0200
          Re: A certainl part of an if() structure never gets executed. Νικόλαος Κούρας <support@superhost.gr> - 2013-06-12 13:59 +0300
          Re: A certainl part of an if() structure never gets executed. Νικόλαος Κούρας <support@superhost.gr> - 2013-06-12 14:03 +0300
            Re: A certainl part of an if() structure never gets executed. Fábio Santos <fabiosantosart@gmail.com> - 2013-06-12 12:49 +0100
              Re: A certainl part of an if() structure never gets executed. Νικόλαος Κούρας <support@superhost.gr> - 2013-06-12 15:39 +0300
          Re: A certainl part of an if() structure never gets executed. feedthetroll@gmx.de - 2013-06-12 04:07 -0700
            Re: A certainl part of an if() structure never gets executed. Chris Angelico <rosuav@gmail.com> - 2013-06-13 06:15 +1000
          Re: A certainl part of an if() structure never gets executed. Νικόλαος Κούρας <support@superhost.gr> - 2013-06-12 14:17 +0300
            Re: A certainl part of an if() structure never gets executed. MRAB <python@mrabarnett.plus.com> - 2013-06-12 17:40 +0100
              Re: A certainl part of an if() structure never gets executed. Νικόλαος Κούρας <support@superhost.gr> - 2013-06-12 20:13 +0300
                Re: A certainl part of an if() structure never gets executed. MRAB <python@mrabarnett.plus.com> - 2013-06-12 18:53 +0100
                  Re: A certainl part of an if() structure never gets executed. Νικόλαος Κούρας <support@superhost.gr> - 2013-06-12 21:06 +0300
                    Re: A certainl part of an if() structure never gets executed. Sibylle Koczian <nulla.epistola@web.de> - 2013-06-12 21:48 +0200
                      Re: A certainl part of an if() structure never gets executed. Νικόλαος Κούρας <support@superhost.gr> - 2013-06-12 23:00 +0300
                        Re: A certainl part of an if() structure never gets executed. Chris Angelico <rosuav@gmail.com> - 2013-06-13 06:16 +1000
                        Re: A certainl part of an if() structure never gets executed. Sibylle Koczian <nulla.epistola@web.de> - 2013-06-12 23:16 +0200
                          Re: A certainl part of an if() structure never gets executed. Νικόλαος Κούρας <support@superhost.gr> - 2013-06-13 17:47 +0300
            Re: A certainl part of an if() structure never gets executed. Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-13 01:55 +0000
              Re: A certainl part of an if() structure never gets executed. Chris Angelico <rosuav@gmail.com> - 2013-06-13 12:03 +1000
              Re: A certainl part of an if() structure never gets executed. Kushal Kumaran <kushal.kumaran+python@gmail.com> - 2013-06-13 10:05 +0530
              Re: A certainl part of an if() structure never gets executed. Chris Angelico <rosuav@gmail.com> - 2013-06-13 14:39 +1000
              Re: A certainl part of an if() structure never gets executed. Νικόλαος Κούρας <support@superhost.gr> - 2013-06-13 08:36 +0300
              Re: A certainl part of an if() structure never gets executed. Νικόλαος Κούρας <support@superhost.gr> - 2013-06-13 10:11 +0300
                Re: A certainl part of an if() structure never gets executed. Sibylle Koczian <nulla.epistola@web.de> - 2013-06-13 14:22 +0200
                  Re: A certainl part of an if() structure never gets executed. Νικόλαος Κούρας <support@superhost.gr> - 2013-06-13 17:26 +0300
                    Re: A certainl part of an if() structure never gets executed. Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-14 01:14 +0000
                      Re: A certainl part of an if() structure never gets executed. Nick the Gr33k <support@superhost.gr> - 2013-06-14 11:03 +0300
                        Re: A certainl part of an if() structure never gets executed. Chris Angelico <rosuav@gmail.com> - 2013-06-14 18:23 +1000
                        Re: A certainl part of an if() structure never gets executed. "R. Michael Weylandt" <michael.weylandt@gmail.com> - 2013-06-14 09:24 +0100
                        Re: A certainl part of an if() structure never gets executed. Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-06-14 11:28 +0300
                          Re: A certainl part of an if() structure never gets executed. Nick the Gr33k <support@superhost.gr> - 2013-06-14 11:41 +0300
                            Re: A certainl part of an if() structure never gets executed. Chris Angelico <rosuav@gmail.com> - 2013-06-14 18:50 +1000
                            Re: A certainl part of an if() structure never gets executed. Fábio Santos <fabiosantosart@gmail.com> - 2013-06-14 10:03 +0100
                            Re: A certainl part of an if() structure never gets executed. Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-06-14 12:21 +0300
                              Re: A certainl part of an if() structure never gets executed. Nick the Gr33k <support@superhost.gr> - 2013-06-14 12:44 +0300
                                Re: A certainl part of an if() structure never gets executed. Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-06-14 15:40 +0300
                                  Re: A certainl part of an if() structure never gets executed. Nick the Gr33k <support@superhost.gr> - 2013-06-14 16:07 +0300
                                    Re: A certainl part of an if() structure never gets executed. Zero Piraeus <schesis@gmail.com> - 2013-06-14 09:48 -0400
                                      Re: A certainl part of an if() structure never gets executed. rusi <rustompmody@gmail.com> - 2013-06-14 07:05 -0700
                                      Re: A certainl part of an if() structure never gets executed. Nick the Gr33k <support@superhost.gr> - 2013-06-14 17:08 +0300
                                    Re: A certainl part of an if() structure never gets executed. Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-14 16:31 +0000
                                      Re: A certainl part of an if() structure never gets executed. Nick the Gr33k <support@superhost.gr> - 2013-06-14 19:56 +0300
                                        Re: A certainl part of an if() structure never gets executed. Chris Angelico <rosuav@gmail.com> - 2013-06-15 03:18 +1000
                                        Re: A certainl part of an if() structure never gets executed. Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-06-14 21:17 +0300
                                        Re: A certainl part of an if() structure never gets executed. Larry Hudson <orgnut@yahoo.com> - 2013-06-14 22:27 -0700
                                          Re: A certainl part of an if() structure never gets executed. Nick the Gr33k <support@superhost.gr> - 2013-06-15 11:39 +0300
                                            Re: A certainl part of an if() structure never gets executed. Lele Gaifax <lele@metapensiero.it> - 2013-06-15 11:54 +0200
                                              Re: A certainl part of an if() structure never gets executed. Nick the Gr33k <support@superhost.gr> - 2013-06-15 16:07 +0300
                                                Re: A certainl part of an if() structure never gets executed. Michael Torrie <torriem@gmail.com> - 2013-06-15 09:53 -0600
                                                  Re: A certainl part of an if() structure never gets executed. Nick the Gr33k <support@superhost.gr> - 2013-06-15 19:18 +0300
                                                    Re: A certainl part of an if() structure never gets executed. Michael Torrie <torriem@gmail.com> - 2013-06-15 11:45 -0600
                                                    Re: A certainl part of an if() structure never gets executed. Denis McMahon <denismfmcmahon@gmail.com> - 2013-06-16 06:32 +0000
                                                      Re: A certainl part of an if() structure never gets executed. Nick the Gr33k <support@superhost.gr> - 2013-06-16 11:07 +0300
                                                        Re: A certainl part of an if() structure never gets executed. Denis McMahon <denismfmcmahon@gmail.com> - 2013-06-16 09:22 +0000
                                                          Re: A certainl part of an if() structure never gets executed. Nick the Gr33k <support@superhost.gr> - 2013-06-16 12:59 +0300
                                                            Re: A certainl part of an if() structure never gets executed. "R. Michael Weylandt" <michael.weylandt@gmail.com> - 2013-06-16 11:42 +0100
                                                              Re: A certainl part of an if() structure never gets executed. Ferrous Cranus <support@superhost.gr> - 2013-06-16 14:06 +0300
                                                                Re: A certainl part of an if() structure never gets executed. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-16 12:26 +0100
                                                                Re: A certainl part of an if() structure never gets executed. YBM <ybmess@nooos.fr.invalid> - 2013-06-16 14:00 +0200
                                                                Re: A certainl part of an if() structure never gets executed. "R. Michael Weylandt" <michael.weylandt@gmail.com> - 2013-06-16 13:04 +0100
                                                                  Re: A certainl part of an if() structure never gets executed. Ferrous Cranus <support@superhost.gr> - 2013-06-16 16:38 +0300
                                                                    Re: A certainl part of an if() structure never gets executed. "R. Michael Weylandt" <michael.weylandt@gmail.com> - 2013-06-16 19:50 +0100
                                                            Re: A certainl part of an if() structure never gets executed. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-16 11:52 +0100
                                                            Re: A certainl part of an if() structure never gets executed. Denis McMahon <denismfmcmahon@gmail.com> - 2013-06-16 10:51 +0000
                                                              Compiling vs interpreting [was Re: A certainl part of an if() structure never gets executed.] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-16 12:07 +0000
                                                                Re: Compiling vs interpreting [was Re: A certainl part of an if() structure never gets executed.] Mark Janssen <dreamingforward@gmail.com> - 2013-06-16 12:31 -0700
                                                                  Re: Compiling vs interpreting [was Re: A certainl part of an if() structure never gets executed.] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-16 20:02 +0000
                                                                    Re: Compiling vs interpreting [was Re: A certainl part of an if() structure never gets executed.] Chris Angelico <rosuav@gmail.com> - 2013-06-17 08:26 +1000
                                                                Re: Compiling vs interpreting [was Re: A certainl part of an if() structure never gets executed.] Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-06-16 23:13 -0400
                                                            Re: A certainl part of an if() structure never gets executed. Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-06-16 14:13 +0300
                                                              Re: A certainl part of an if() structure never gets executed. Ferrous Cranus <support@superhost.gr> - 2013-06-16 16:47 +0300
                                                                Re: A certainl part of an if() structure never gets executed. "R. Michael Weylandt" <michael.weylandt@gmail.com> - 2013-06-16 19:53 +0100
                                                                  Re: A certainl part of an if() structure never gets executed. Νίκος <support@superhost.gr> - 2013-06-17 08:17 +0300
                                                                    Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-17 06:51 +0000
                                                                      Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Simpleton <support@superhost.gr> - 2013-06-17 14:34 +0300
                                                                        Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Michael Torrie <torriem@gmail.com> - 2013-06-17 05:58 -0600
                                                                          Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Simpleton <support@superhost.gr> - 2013-06-17 18:50 +0300
                                                                            Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Larry Hudson <orgnut@yahoo.com> - 2013-06-17 23:39 -0700
                                                                              Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-18 07:24 +0000
                                                                              Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Νίκος <support@superhost.gr> - 2013-06-18 11:49 +0300
                                                                                Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-18 09:05 +0000
                                                                                  Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Νίκος <support@superhost.gr> - 2013-06-18 12:51 +0300
                                                                                    Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Chris Angelico <rosuav@gmail.com> - 2013-06-18 20:22 +1000
                                                                                    Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Michael Torrie <torriem@gmail.com> - 2013-06-19 23:16 -0600
                                                                                      Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-20 05:48 +0000
                                                                                        Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Michael Torrie <torriem@gmail.com> - 2013-06-20 00:01 -0600
                                                                                          Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] 88888 Dihedral <dihedral88888@gmail.com> - 2013-06-26 01:18 -0700
                                                                                    Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Michael Torrie <torriem@gmail.com> - 2013-06-19 23:44 -0600
                                                                                    Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Roel Schroeven <roel@roelschroeven.net> - 2013-06-20 19:19 +0200
                                                                        Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Terry Reedy <tjreedy@udel.edu> - 2013-06-17 10:22 -0400
                                                                          Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Simpleton <support@superhost.gr> - 2013-06-17 18:55 +0300
                                                                            Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Joel Goldstick <joel.goldstick@gmail.com> - 2013-06-17 12:26 -0400
                                                                            Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Benjamin Kaplan <benjamin.kaplan@case.edu> - 2013-06-17 09:23 -0700
                                                                              Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Νίκος <support@superhost.gr> - 2013-06-17 20:17 +0300
                                                                                Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Terry Reedy <tjreedy@udel.edu> - 2013-06-17 18:16 -0400
                                                                        Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-17 23:09 +0000
                                                                          Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Νίκος <support@superhost.gr> - 2013-06-18 02:26 +0300
                                                                            Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-18 00:41 +0000
                                                                              Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Dave Angel <davea@davea.name> - 2013-06-17 21:06 -0400
                                                                                Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-18 02:42 +0000
                                                                                  Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Dave Angel <davea@davea.name> - 2013-06-18 00:12 -0400
                                                                                    Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-18 06:04 +0000
                                                                              Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-18 02:38 +0000
                                                                                Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-18 02:46 +0000
                                                                            Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-06-17 21:34 -0400
                                                                            Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.] Marcin Szamotulski <mszamot@gmail.com> - 2013-06-18 04:22 +0100
                                                                    Re: A certainl part of an if() structure never gets executed. Michael Weylandt <michael.weylandt@gmail.com> - 2013-06-17 07:56 +0100
                                                          Re: A certainl part of an if() structure never gets executed. Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-16 12:50 +0000
                                                      OT: C vs Python terminology (was: A certainl part of an if() structure never gets executed) Andreas Perstinger <andipersti@gmail.com> - 2013-06-16 13:22 +0200
                                                      Re: OT: C vs Python terminology Dave Angel <davea@davea.name> - 2013-06-16 08:55 -0400
                                                      Re: OT: C vs Python terminology Andreas Perstinger <andipersti@gmail.com> - 2013-06-16 17:02 +0200
                                                      Re: OT: C vs Python terminology Dave Angel <davea@davea.name> - 2013-06-16 21:58 -0400
                        Re: A certainl part of an if() structure never gets executed. "R. Michael Weylandt" <michael.weylandt@gmail.com> - 2013-06-14 09:28 +0100
                        Re: A certainl part of an if() structure never gets executed. Fábio Santos <fabiosantosart@gmail.com> - 2013-06-14 09:35 +0100
                        Re: A certainl part of an if() structure never gets executed. Nick the Gr33k <support@superhost.gr> - 2013-06-14 11:44 +0300
                          Re: A certainl part of an if() structure never gets executed. Chris Angelico <rosuav@gmail.com> - 2013-06-14 18:57 +1000
                            Re: A certainl part of an if() structure never gets executed. Nick the Gr33k <support@superhost.gr> - 2013-06-14 12:00 +0300
                              Re: A certainl part of an if() structure never gets executed. Chris Angelico <rosuav@gmail.com> - 2013-06-14 19:12 +1000
                                Re: A certainl part of an if() structure never gets executed. Nick the Gr33k <support@superhost.gr> - 2013-06-14 12:47 +0300
                                  Re: A certainl part of an if() structure never gets executed. Tim Roberts <timr@probo.com> - 2013-06-15 18:55 -0700
                                    Re: A certainl part of an if() structure never gets executed. Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-16 05:09 +0000
                                    Re: A certainl part of an if() structure never gets executed. Nick the Gr33k <support@superhost.gr> - 2013-06-16 11:20 +0300
                                      Re: A certainl part of an if() structure never gets executed. Tim Roberts <timr@probo.com> - 2013-06-18 22:08 -0700
                                        Re: A certainl part of an if() structure never gets executed. Dave Angel <davea@davea.name> - 2013-06-19 01:42 -0400
                                        Re: A certainl part of an if() structure never gets executed. Chris Angelico <rosuav@gmail.com> - 2013-06-19 17:14 +1000
                                        Re: A certainl part of an if() structure never gets executed. Νίκος <support@superhost.gr> - 2013-06-19 10:49 +0300
                                        Re: A certainl part of an if() structure never gets executed. Dave Angel <davea@davea.name> - 2013-06-19 04:06 -0400
                                        Re: A certainl part of an if() structure never gets executed. Chris Angelico <rosuav@gmail.com> - 2013-06-19 18:21 +1000
                                          Re: A certainl part of an if() structure never gets executed. Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-19 08:55 +0000
                                            Re: A certainl part of an if() structure never gets executed. Chris Angelico <rosuav@gmail.com> - 2013-06-19 19:14 +1000
                              Re: A certainl part of an if() structure never gets executed. Grant Edwards <invalid@invalid.invalid> - 2013-06-14 14:38 +0000
                          Re: A certainl part of an if() structure never gets executed. Fábio Santos <fabiosantosart@gmail.com> - 2013-06-14 10:05 +0100
        Re: A certainl part of an if() structure never gets executed. Denis McMahon <denismfmcmahon@gmail.com> - 2013-06-14 12:03 +0000
          Re: A certainl part of an if() structure never gets executed. Nick the Gr33k <support@superhost.gr> - 2013-06-14 15:31 +0300

Page 2 of 9 — ← Prev page 1 [2] 3 4 5 6 7 8 9  Next page →


#47738

FromMichael Torrie <torriem@gmail.com>
Date2013-06-11 23:05 -0600
Message-ID<mailman.3048.1371013520.3114.python-list@python.org>
In reply to#47701
On 06/11/2013 10:49 PM, Michael Torrie wrote:
> ----------- my_cgi_script.py -------------------
> import do_something
> 
> # handle cgi stuff
> # get name, month year
> dosomething.dosomething(name, month, year)

Make that do_something.do_something

[toc] | [prev] | [next] | [standalone]


#47739

FromTim Roberts <timr@probo.com>
Date2013-06-11 22:44 -0700
Message-ID<pf2gr8ho0sp2v1o1ugknrhuit93nc6brar@4ax.com>
In reply to#47701
???????? ?????? <nikos.gr33k@gmail.com> wrote:
>
>[code]
>		if not re.search( '=', name ) and not re.search( '=', month ) and not re.search( '=', year ):
>			cur.execute( '''SELECT * FROM works WHERE clientsID = (SELECT id FROM clients WHERE name = %s) and MONTH(lastvisit) = %s and YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', (name, month, year) )
>		elif not re.search( '=', month ) and not re.search( '=', year ):
>			cur.execute( '''SELECT * FROM works WHERE MONTH(lastvisit) = %s and YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', (month, year) )
>		elif not re.search( '=', year ):
>			cur.execute( '''SELECT * FROM works WHERE YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', year )

There is so much you didn't tell us here, including which database you are
using.

With most Python database adapters, the second parameter of the "execute"
method must be a tuple.  "year" is not a tuple.  My guess is that this will
work fine:
    cur.execute( 
    "SELECT * FROM works WHERE YEAR(lastvisit)=%s ORDER BY lastvisit",
    (year,) )

It seems silly to fire up a regular expression compiler to look for a
single character.  
    if name.find('=') < 0 and month.find('=') < 0 and year.find('=') < 0:
-- 
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

[toc] | [prev] | [next] | [standalone]


#47742

Fromalex23 <wuwei23@gmail.com>
Date2013-06-11 23:16 -0700
Message-ID<560afe1f-5803-4cbc-a607-43e33f6d5cde@kt20g2000pbb.googlegroups.com>
In reply to#47739
On Jun 12, 3:44 pm, Tim Roberts <t...@probo.com> wrote:
> It seems silly to fire up a regular expression compiler to look for a
> single character.
>     if name.find('=') < 0 and month.find('=') < 0 and year.find('=') < 0:

If truthiness is the only concern, I prefer using `in`:

    if '=' in name and '=' in month ...

[toc] | [prev] | [next] | [standalone]


#47807

FromGrant Edwards <invalid@invalid.invalid>
Date2013-06-12 14:38 +0000
Message-ID<kpa155$qhk$1@reader1.panix.com>
In reply to#47739
On 2013-06-12, Tim Roberts <timr@probo.com> wrote:
> ???????? ?????? <nikos.gr33k@gmail.com> wrote:
>>
>>[code]
>>		if not re.search( '=', name ) and not re.search( '=', month ) and not re.search( '=', year ):
>>			cur.execute( '''SELECT * FROM works WHERE clientsID = (SELECT id FROM clients WHERE name = %s) and MONTH(lastvisit) = %s and YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', (name, month, year) )
>>		elif not re.search( '=', month ) and not re.search( '=', year ):
>>			cur.execute( '''SELECT * FROM works WHERE MONTH(lastvisit) = %s and YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', (month, year) )
>>		elif not re.search( '=', year ):
>>			cur.execute( '''SELECT * FROM works WHERE YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', year )
>
> There is so much you didn't tell us here, including which database you are
> using.

Are you guys _still_ on Nikos hook?

[No, I don't really think he's trolling, but it would be really
impressive if he were.]

Anyway, I salute your patience.

-- 
Grant Edwards               grant.b.edwards        Yow! ... I'm IMAGINING a
                                  at               sensuous GIRAFFE, CAVORTING
                              gmail.com            in the BACK ROOM of a
                                                   KOSHER DELI --

[toc] | [prev] | [next] | [standalone]


#47810

FromNeil Cerutti <neilc@norwich.edu>
Date2013-06-12 14:55 +0000
Message-ID<b1rgf6Fo4b0U1@mid.individual.net>
In reply to#47807
On 2013-06-12, Grant Edwards <invalid@invalid.invalid> wrote:
> On 2013-06-12, Tim Roberts <timr@probo.com> wrote:
>> ???????? ?????? <nikos.gr33k@gmail.com> wrote:
>>>
>>>[code]
>>>		if not re.search( '=', name ) and not re.search( '=', month ) and not re.search( '=', year ):
>>>			cur.execute( '''SELECT * FROM works WHERE clientsID = (SELECT id FROM clients WHERE name = %s) and MONTH(lastvisit) = %s and YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', (name, month, year) )
>>>		elif not re.search( '=', month ) and not re.search( '=', year ):
>>>			cur.execute( '''SELECT * FROM works WHERE MONTH(lastvisit) = %s and YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', (month, year) )
>>>		elif not re.search( '=', year ):
>>>			cur.execute( '''SELECT * FROM works WHERE YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', year )
>>
>> There is so much you didn't tell us here, including which database you are
>> using.
>
> Are you guys _still_ on Nikos hook?
>
> [No, I don't really think he's trolling, but it would be really
> impressive if he were.]

He's definitely trolling. I can't think of any other reason to
make it so hard to kill-file himself.

-- 
Neil Cerutti

[toc] | [prev] | [next] | [standalone]


#47941

FromZero Piraeus <schesis@gmail.com>
Date2013-06-12 11:20 -0400
Message-ID<mailman.3181.1371124494.3114.python-list@python.org>
In reply to#47810
:

On 12 June 2013 10:55, Neil Cerutti <neilc@norwich.edu> wrote:
>
> He's definitely trolling. I can't think of any other reason to
> make it so hard to kill-file himself.

He's not a troll, he's a help vampire:

  http://slash7.com/2006/12/22/vampires/

... a particularly extreme example, I'll admit: his lack of
consideration for others apparently knows no bounds. The email thing
is just another aspect of that.

 -[]z.

[toc] | [prev] | [next] | [standalone]


#47946

Fromrusi <rustompmody@gmail.com>
Date2013-06-13 05:30 -0700
Message-ID<8a75b1e4-41e8-45b5-ac9e-6611a469830a@g9g2000pbd.googlegroups.com>
In reply to#47941
On Jun 12, 8:20 pm, Zero Piraeus <sche...@gmail.com> wrote:
> :
>
> On 12 June 2013 10:55, Neil Cerutti <ne...@norwich.edu> wrote:
>
>
>
> > He's definitely trolling. I can't think of any other reason to
> > make it so hard to kill-file himself.
>
> He's not a troll, he's a help vampire:
>
>  http://slash7.com/2006/12/22/vampires/
>
> ... a particularly extreme example, I'll admit

Thanks for that term.

[toc] | [prev] | [next] | [standalone]


#47953

FromRoy Smith <roy@panix.com>
Date2013-06-13 09:01 -0400
Message-ID<roy-33547B.09013613062013@news.panix.com>
In reply to#47946
In article 
<8a75b1e4-41e8-45b5-ac9e-6611a469830a@g9g2000pbd.googlegroups.com>,
 rusi <rustompmody@gmail.com> wrote:

> On Jun 12, 8:20 pm, Zero Piraeus <sche...@gmail.com> wrote:
> > :
> >
> > On 12 June 2013 10:55, Neil Cerutti <ne...@norwich.edu> wrote:
> >
> >
> >
> > > He's definitely trolling. I can't think of any other reason to
> > > make it so hard to kill-file himself.
> >
> > He's not a troll, he's a help vampire:
> >
> >  http://slash7.com/2006/12/22/vampires/
> >
> > ... a particularly extreme example, I'll admit
> 
> Thanks for that term.

Yeah.  I've never heard that before, but it's perfect.

[toc] | [prev] | [next] | [standalone]


#47948

FromNeil Cerutti <neilc@norwich.edu>
Date2013-06-13 12:34 +0000
Message-ID<b1tshpF9297U1@mid.individual.net>
In reply to#47941
On 2013-06-12, Zero Piraeus <schesis@gmail.com> wrote:
> On 12 June 2013 10:55, Neil Cerutti <neilc@norwich.edu> wrote:
>>
>> He's definitely trolling. I can't think of any other reason to
>> make it so hard to kill-file himself.
>
> He's not a troll, he's a help vampire:
>
>   http://slash7.com/2006/12/22/vampires/
>
> ... a particularly extreme example, I'll admit: his lack of
> consideration for others apparently knows no bounds. The email thing
> is just another aspect of that.

He's also changed his NNTP-Posting-Host, just yesterday, along
with at least three changes in From address, and one change in
Reply-To.

And to start with he came here with an obvious troll name.

-- 
Neil Cerutti

[toc] | [prev] | [next] | [standalone]


#47989

FromΝικόλαος Κούρας <support@superhost.gr>
Date2013-06-13 20:00 +0300
Message-ID<kpcts5$21co$6@news.ntua.gr>
In reply to#47948
		if '-' not in name + month + year:
			cur.execute( '''SELECT * FROM works WHERE clientsID = (SELECT id FROM 
clients WHERE name = %s) and MONTH(lastvisit) = %s and YEAR(lastvisit) = 
%s ORDER BY lastvisit ASC''', (name, month, year) )
		elif '-' not in name + year:
			cur.execute( '''SELECT * FROM works WHERE clientsID = (SELECT id FROM 
clients WHERE name = %s) and YEAR(lastvisit) = %s ORDER BY lastvisit 
ASC''', (name, year) )
		elif '-' not in month + year:
			cur.execute( '''SELECT * FROM works WHERE MONTH(lastvisit) = %s and 
YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', (month, year) )
		elif '-' not in year:
			cur.execute( '''SELECT * FROM works WHERE YEAR(lastvisit) = %s ORDER 
BY lastvisit ASC''', year )


This finally worked!

[toc] | [prev] | [next] | [standalone]


#48672

FromJan Riechers <janpeterr@freenet.de>
Date2013-06-19 01:05 +0300
Message-ID<mailman.3561.1371594689.3114.python-list@python.org>
In reply to#47989
On 13.06.2013 20:00, Νικόλαος Κούρας wrote:
>          if '-' not in name + month + year:
>              cur.execute( '''SELECT * FROM works WHERE clientsID =
> (SELECT id FROM clients WHERE name = %s) and MONTH(lastvisit) = %s and
> YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', (name, month, year) )
>          elif '-' not in name + year:
>              cur.execute( '''SELECT * FROM works WHERE clientsID =
> (SELECT id FROM clients WHERE name = %s) and YEAR(lastvisit) = %s ORDER
> BY lastvisit ASC''', (name, year) )
>          elif '-' not in month + year:
>              cur.execute( '''SELECT * FROM works WHERE MONTH(lastvisit)
> = %s and YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', (month, year) )
>          elif '-' not in year:
>              cur.execute( '''SELECT * FROM works WHERE YEAR(lastvisit) =
> %s ORDER BY lastvisit ASC''', year )
>
>
> This finally worked!


I spared myself to read the whole thread cause its super long and I find 
it admirable that some people took time to troubleshoot the issue and 
(even) added optimizations of what can be done differently/better.. even 
so it seems there was only a wrong char used in the ifs?..

And as a short note - you should add code which handles the worst-case 
scenario (everthing fails, nothing valid, avoid into code which might 
require variables/data which is not present and so forth..)


But generally speaking:
As a best practice in any language not just Python.
If you have the option to print out evaluations and values, use it!


As rule of thumb for debugging code:
1. Print out what values you get in (from user, in(to) a function)
2a. Test statements and logic either by setting a print (in your case 
inside each if) with something like "if1", "if2", ... "else fired" or 
what you prefer OR do a direct comparison if the evaluation statements 
are not super long (someone mentioned that..)
2b. In case of longer statements/calculations, break them into chunks, 
simplify the problem to smaller ones and try to verify the results as 
possible (being "far apart" and "getting closer" after each time is 
already a good hint in calculations..)
3. If you catch data from a database and you see now results -> print 
out if your search/query even can return anything at all or if your 
query itself has a flaw or similar.

Optional but also useful:
4. On the end of a function, print if the output of the function is as 
expected

This small technique costs minimal time, but brings a brilliant ability:
1. Understand the code flow
2. Understand mistakes
3. Save yourself a big time by searching targeted for code parts which 
are executed..

..and ignore not directly connected code - for example when looking at 
other peoples code without documentation, comments or introduction.
This can spare loads of headaches.

And all this can be done in a couple of minutes..

Jan

[toc] | [prev] | [next] | [standalone]


#47754

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2013-06-12 08:27 +0000
Message-ID<kp9bcq$o1i$2@dont-email.me>
In reply to#47701
On Tue, 11 Jun 2013 13:20:52 -0700, Νικόλαος Κούρας wrote:

> The above if structure works correctly *only* if the user sumbits by
> form:
> 
> name, month, year or month, year
> 
> If, he just enter a year in the form and sumbit then, i get no error,
> but no results displayed back.
> 
> Any ideas as to why this might happen?

Yes, I know exactly why this is happening.

It is for one of two reasons. You may determine which one using the 
following secret code which I stole from the illuminati in 1836:

import random

reason = { 1: "Input data is not as expected by coder", 2: "Flow control 
logic not performing as coder expects", 3: "Badger Badger Badger Badger 
Badger Badger Badger Badger Mushroom", 4: "Please try again", 5: 
"Snaaaaake", 6: "Grumpy cat says fix your own damn code", 7: "I'll be 
back" }

print reason[ random.choice( reason.keys() ) ]

Note - this only has a small chance of actually doing what you want (ie 
giving a possibly accurate answer), but it sounds as if that's a level of 
precision you're used to working with anyway.

On a slightly more serious note, if you can't apply yourself to debugging 
a case of "the program logic isn't doing what I expect" for some value of 
program logic that you coded, that may be a hint that:

a) you don't actually understand what the program logic is doing

b) you shouldn't be writing logic so complex that you can't see how to 
debug it

c) your logic is overly convoluted and complex

d) all of the above

So perhaps you need to scrub the logic altogether, and start again taking 
smaller steps.

You could also perhaps do with a lesson in De Morgan's theorem:

not a and not b and not c = not ( a or b or c )

not a or not b or not c = not ( a and b and c )

and sometimes the alternative form is easier to understand

Now, looking at your code here are two important questions:

(1) What is the initial values of name, month and year?
(2) Which block is actually being executed?

Bear in mind that if a branch other than one you expect to be executed is 
executing, the fail condition might not be what you think it is. 
Specifically, is it possible that the code is executing the wrong branch 
and tripping up when it tries to generate or perhaps execute the sql 
statement empty strings, or just not getting any result from the sql 
because of the empty strings?

Hint - take the code from the current file, apply a liberal smattering of 
print statements, and test it for various values of month, year and name.

def test(name, month, year):
        print "name, month, year ::", name, month, year
	if not re.search( '=', name ) and not re.search( '=', month ) and 
not re.search( '=', year ):
		print "branch 1"
	elif not re.search( '=', month ) and not re.search( '=', year ):
		print "branch 2"
	elif not re.search( '=', year ):
		print "branch 3"
	else:
		print "branch 4"

# testing logic for 8 possible input conditions

test("=", "=", "=")
test("=", "=", "x")
test("=", "x", "=")
test("=", "x", "x")
test("x", "=", "=")
test("x", "=", "x")
test("x", "x", "=")
test("x", "x", "x")

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#47757

FromΝικόλαος Κούρας <support@superhost.gr>
Date2013-06-12 11:54 +0300
Message-ID<kp9d02$1jfb$1@news.ntua.gr>
In reply to#47754
On 12/6/2013 11:27 πμ, Denis McMahon wrote:
> On Tue, 11 Jun 2013 13:20:52 -0700, Νικόλαος Κούρας wrote:
>
>> The above if structure works correctly *only* if the user sumbits by
>> form:
>>
>> name, month, year or month, year
>>
>> If, he just enter a year in the form and sumbit then, i get no error,
>> but no results displayed back.
>>
>> Any ideas as to why this might happen?
>
> Yes, I know exactly why this is happening.
>
> It is for one of two reasons. You may determine which one using the
> following secret code which I stole from the illuminati in 1836:
>
> import random
>
> reason = { 1: "Input data is not as expected by coder", 2: "Flow control
> logic not performing as coder expects", 3: "Badger Badger Badger Badger
> Badger Badger Badger Badger Mushroom", 4: "Please try again", 5:
> "Snaaaaake", 6: "Grumpy cat says fix your own damn code", 7: "I'll be
> back" }
>
> print reason[ random.choice( reason.keys() ) ]
>
> Note - this only has a small chance of actually doing what you want (ie
> giving a possibly accurate answer), but it sounds as if that's a level of
> precision you're used to working with anyway.
>
> On a slightly more serious note, if you can't apply yourself to debugging
> a case of "the program logic isn't doing what I expect" for some value of
> program logic that you coded, that may be a hint that:
>
> a) you don't actually understand what the program logic is doing
>
> b) you shouldn't be writing logic so complex that you can't see how to
> debug it
>
> c) your logic is overly convoluted and complex
>
> d) all of the above
>
> So perhaps you need to scrub the logic altogether, and start again taking
> smaller steps.
>
> You could also perhaps do with a lesson in De Morgan's theorem:
>
> not a and not b and not c = not ( a or b or c )
>
> not a or not b or not c = not ( a and b and c )
>
> and sometimes the alternative form is easier to understand
>
> Now, looking at your code here are two important questions:
>
> (1) What is the initial values of name, month and year?
> (2) Which block is actually being executed?
>
> Bear in mind that if a branch other than one you expect to be executed is
> executing, the fail condition might not be what you think it is.
> Specifically, is it possible that the code is executing the wrong branch
> and tripping up when it tries to generate or perhaps execute the sql
> statement empty strings, or just not getting any result from the sql
> because of the empty strings?
>
> Hint - take the code from the current file, apply a liberal smattering of
> print statements, and test it for various values of month, year and name.
>
> def test(name, month, year):
>          print "name, month, year ::", name, month, year
> 	if not re.search( '=', name ) and not re.search( '=', month ) and
> not re.search( '=', year ):
> 		print "branch 1"
> 	elif not re.search( '=', month ) and not re.search( '=', year ):
> 		print "branch 2"
> 	elif not re.search( '=', year ):
> 		print "branch 3"
> 	else:
> 		print "branch 4"
>
> # testing logic for 8 possible input conditions
>
> test("=", "=", "=")
> test("=", "=", "x")
> test("=", "x", "=")
> test("=", "x", "x")
> test("x", "=", "=")
> test("x", "=", "x")
> test("x", "x", "=")
> test("x", "x", "x")
>

Thank you but i already foudn out what the problem was, i just don't 
known how to fix it. Here is is again:


Here is the defines of those variables. as you can see are all tuples

# populate names, months, years
names.add( '==========' )
months = ( '==========', 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος',
'Απρίλιος', 'Μάϊος', 'Ιούνιος',
            'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος',
'Νοέμβριος',
'Δεκέμβριος' )
years = ( '==========', 2010, 2011, 2012, 2013 )


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

i used         print( name, month, year ) and noticed that all values 
returned as expected when selected fro drop-down menus and submitted.

But when it comes to select '==========' from month instead of
'==========' to be submitted a zero gets submitted and i think the 
problem is the way i'm filling up months into the drop down menu which is:


for i, month in enumerate(months):
     print('<option value="%s"> %s </option>' % (i, month) )


the if case does not execute because of the way it checks for None entry
which is: elif '=' not in year:

but if enumerate yields 0 instead of '==========' then elif '=' not in
year of course fails.

So, i must tell:

for i, month in enumerate(months):
     print('<option value="%s"> %s </option>' % (i, month) )

to somehow return '==========' instead of 0 but don't know how.

[toc] | [prev] | [next] | [standalone]


#47761

FromFábio Santos <fabiosantosart@gmail.com>
Date2013-06-12 10:07 +0100
Message-ID<mailman.3056.1371028068.3114.python-list@python.org>
In reply to#47757
On Wed, Jun 12, 2013 at 9:54 AM, Νικόλαος Κούρας <support@superhost.gr> wrote:
> but if enumerate yields 0 instead of '==========' then elif '=' not in
> year of course fails.
>
> So, i must tell:
>
> for i, month in enumerate(months):
>     print('<option value="%s"> %s </option>' % (i, month) )
>
> to somehow return '==========' instead of 0 but don't know how.
> --
> http://mail.python.org/mailman/listinfo/python-list

Well, you could try this:

> for i, month in enumerate(months):
>     if i == 0:
>         month = ('=' * 10)
>     print('<option value="%s"> %s </option>' % (i, month) )

No?

--
Fábio Santos

[toc] | [prev] | [next] | [standalone]


#47765

FromΝικόλαος Κούρας <support@superhost.gr>
Date2013-06-12 12:19 +0300
Message-ID<kp9ef4$1rjr$1@news.ntua.gr>
In reply to#47761
On 12/6/2013 12:07 μμ, F�bio Santos wrote:
> On Wed, Jun 12, 2013 at 9:54 AM, Νικόλαος Κούρας <support@superhost.gr> wrote:
>> but if enumerate yields 0 instead of '==========' then elif '=' not in
>> year of course fails.
>>
>> So, i must tell:
>>
>> for i, month in enumerate(months):
>>      print('<option value="%s"> %s </option>' % (i, month) )
>>
>> to somehow return '==========' instead of 0 but don't know how.
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>
> Well, you could try this:
>
>> for i, month in enumerate(months):
>>      if i == 0:
>>          month = ('=' * 10)
>>      print('<option value="%s"> %s </option>' % (i, month) )
>
> No?

I'am afraid not Fabio, i just tried byt sumbitting only the year, not 
name not month

after printign the valeus to see what went wrong, the values look like:

========== 0 2010

instead of:

========== ==========  2010

========== is the value of the month when its not selected by the user, 
but even with your suggestions it reurns t0 intead of the equal signs.....

[toc] | [prev] | [next] | [standalone]


#47769

FromFábio Santos <fabiosantosart@gmail.com>
Date2013-06-12 10:57 +0100
Message-ID<mailman.3059.1371031050.3114.python-list@python.org>
In reply to#47765

[Multipart message — attachments visible in raw view] — view raw

On 12 Jun 2013 10:29, "Νικόλαος Κούρας" <support@superhost.gr> wrote:
>
> On 12/6/2013 12:07 μμ, F�bio Santos wrote:
>>
>> On Wed, Jun 12, 2013 at 9:54 AM, Νικόλαος Κούρας <support@superhost.gr>
wrote:
>>>
>>> but if enumerate yields 0 instead of '==========' then elif '=' not in
>>> year of course fails.
>>>
>>> So, i must tell:
>>>
>>> for i, month in enumerate(months):
>>>      print('<option value="%s"> %s </option>' % (i, month) )
>>>
>>> to somehow return '==========' instead of 0 but don't know how.
>>> --
>>> http://mail.python.org/mailman/listinfo/python-list
>>
>>
>> Well, you could try this:
>>
>>> for i, month in enumerate(months):
>>>      if i == 0:
>>>          month = ('=' * 10)
>>>      print('<option value="%s"> %s </option>' % (i, month) )
>>
>>
>> No?
>
>
> I'am afraid not Fabio, i just tried byt sumbitting only the year, not
name not month
>
> after printign the valeus to see what went wrong, the values look like:
>
> ========== 0 2010
>
> instead of:
>
> ========== ==========  2010
>
> ========== is the value of the month when its not selected by the user,
but even with your suggestions it reurns t0 intead of the equal signs.....
>
> --
> http://mail.python.org/mailman/listinfo/python-list

Have you tried

i = month = '=' * 10

I had assumed you just wanted those equal signs for the user display.

[toc] | [prev] | [next] | [standalone]


#47775

FromΝικόλαος Κούρας <support@superhost.gr>
Date2013-06-12 13:45 +0300
Message-ID<kp9jft$2v72$1@news.ntua.gr>
In reply to#47761

-------- Original Message --------
Subject: Re: A certainl part of an if() structure never gets executed.
Date: Wed, 12 Jun 2013 10:07:39 +0100
From: Fábio Santos <fabiosantosart@gmail.com>
To: Νικόλαος Κούρας <support@superhost.gr>
CC: python-list@python.org <python-list@python.org>
Newsgroups: comp.lang.python
References: <2bc90d3b-09c2-4315-9357-ff7f039465e0@googlegroups.com> 
<kp9bcq$o1i$2@dont-email.me> <kp9d02$1jfb$1@news.ntua.gr>

On Wed, Jun 12, 2013 at 9:54 AM, Νικόλαος Κούρας <support@superhost.gr> 
wrote:
 > but if enumerate yields 0 instead of '==========' then elif '=' not in
 > year of course fails.
 >
 > So, i must tell:
 >
 > for i, month in enumerate(months):
 >     print('<option value="%s"> %s </option>' % (i, month) )
 >
 > to somehow return '==========' instead of 0 but don't know how.
 > --
 > http://mail.python.org/mailman/listinfo/python-list

Well, you could try this:

 > for i, month in enumerate(months):
 >     if i == 0:
 >         month = ('=' * 10)
 >     print('<option value="%s"> %s </option>' % (i, month) )

No?

You can see if for yourself if you go to:
http://superhost.gr/?page=pelatologio.py

bottom down where the form drop down menus are:

search will work but f the suer just gives out the year it will never 
make it to the specific if() branch.


[toc] | [prev] | [next] | [standalone]


#47770

FromAndreas Perstinger <andipersti@gmail.com>
Date2013-06-12 12:07 +0200
Message-ID<mailman.3060.1371031686.3114.python-list@python.org>
In reply to#47757
[Please trim your replies to the relevant parts.]

On 12.06.2013 10:54, Νικόλαος Κούρας wrote:
> But when it comes to select '==========' from month instead of
> '==========' to be submitted a zero gets submitted and i think the
> problem is the way i'm filling up months into the drop down menu which is:
>
>
> for i, month in enumerate(months):
>       print('<option value="%s"> %s </option>' % (i, month) )
>
>
> the if case does not execute because of the way it checks for None entry
> which is: elif '=' not in year:
>
> but if enumerate yields 0 instead of '==========' then elif '=' not in
> year of course fails.

How often do we need to tell you that you should reread your posts 
before sending them?
You start with telling us you have problems with "month" and then show 
us code regarding "year"

> So, i must tell:
>
> for i, month in enumerate(months):
>       print('<option value="%s"> %s </option>' % (i, month) )
>
> to somehow return '==========' instead of 0 but don't know how.

As with most of your problems you are barking up the wrong tree.
Why not use the actual value you get from the form to check whether you 
have a valid month?
Do you understand why "0" is submitted instead of "=========="?

Bye, Andreas

[toc] | [prev] | [next] | [standalone]


#47777

FromΝικόλαος Κούρας <support@superhost.gr>
Date2013-06-12 13:59 +0300
Message-ID<kp9k9t$3hc$1@news.ntua.gr>
In reply to#47770
On 12/6/2013 1:07 μμ, Andreas Perstinger wrote:

>> So, i must tell:
>>
>> for i, month in enumerate(months):
>>       print('<option value="%s"> %s </option>' % (i, month) )
>>
>> to somehow return '==========' instead of 0 but don't know how.
>
> As with most of your problems you are barking up the wrong tree.
> Why not use the actual value you get from the form to check whether you
> have a valid month?
> Do you understand why "0" is submitted instead of "=========="?

No, this is exactly what i do not understand.

months = ( '==========', 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 
'Απρίλιος', 'Μάϊος', 'Ιούνιος',
            'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 
'Νοέμβριος', 'Δεκέμβριος' )

This is a tuple containign months. Then we have this:

for i, month in enumerate(months):
       print('<option value="%s"> %s </option>' % (i, month) )

i is assiciated to month in similar fashion as a dic's key to it's value

i = the increasing counter after each iteration in the loop
month = just the displayed month.

when iteration happens we get this:

value 0 for month '=========='
value 1 for month 'Ιανουάριος'
.....
.....
value 12 for month 'Δεκέμβριος'

So when '==========' is being selected as month from the user value 0 is 
beign returned, but what i need is the string '==========' itself, not 
the value.

the year var have no prblem, is the month that always fails the if() 
condition branch.

[toc] | [prev] | [next] | [standalone]


#47778

FromΝικόλαος Κούρας <support@superhost.gr>
Date2013-06-12 14:03 +0300
Message-ID<kp9khp$5ab$1@news.ntua.gr>
In reply to#47770
Oh my God!

i just need to do this:

for i, month in enumerate( months ):
	print('<option value="%s"> %s </option>' % (month, month) )

[toc] | [prev] | [next] | [standalone]


Page 2 of 9 — ← Prev page 1 [2] 3 4 5 6 7 8 9  Next page →

Back to top | Article view | comp.lang.python


csiph-web