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


Groups > comp.lang.python > #111739

Re: Stupid question, just need a quick and dirty fix

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Paul Rubin <no.email@nospam.invalid>
Newsgroups comp.lang.python
Subject Re: Stupid question, just need a quick and dirty fix
Date Thu, 21 Jul 2016 23:03:04 -0700
Organization A noiseless patient Spider
Lines 26
Message-ID <87y44ub46f.fsf@jester.gateway.pace.com> (permalink)
References <e1a10af3-cd57-4a56-98bf-7a9ed8b3d999@googlegroups.com> <CAPTjJmo__i+zZyk+kFe-f8JZy6UYKawPPR_NqXAdfseK4zqJLQ@mail.gmail.com> <mailman.39.1469161719.22221.python-list@python.org> <881b184c-11e4-41e7-a01e-6a21d454ce68@googlegroups.com> <CAPTjJmrqnbobzhzGuiLtdUVgTAnP4togkDqOW3M7pgdnECJFug@mail.gmail.com> <mailman.40.1469162766.22221.python-list@python.org> <2795f3e5-e660-40c6-8a43-97a9613d7577@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="52eac348160ce62b68e4635eee7cc854"; logging-data="32554"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/urQ15j6koUKvjzDGoZYyQ"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:Iu3URPFPmyxgU1NfHpqLSGe8gJ0= sha1:uF1nMERbVvRnC8BDBfwbn6mTyTY=
Xref csiph.com comp.lang.python:111739

Show key headers only | View raw


Jordan Bayless <jmbayless@gmail.com> writes:
> desired = Id < 10 or Id > 133 or Id in good_ids
> When I try to validate whether I passed that check, I'm told there's a
> Name error and it's not defined (using the last line of the snippet
> above).

Id was called IDNum in your earlier pst

> Also, I guess I'm at a loss for what I'm supposed to do with "desired"
> to check it prior to running my email code.
>
> if desired == True: doesn't work 

That should work, but it's more concise and idiomatic to say "if desired: ..."

> I'm headed to bed. Too tired to focus on making this work and I
> apparently really don't 'get' what I'm doing. Maybe I'll be better off
> with fresh eyes on it tomorrow.

You're probably better off reading a basic Python tutorial than trying
to mess with a working piece of code by trial and error without knowing
the language.

  https://docs.python.org/2/tutorial/index.html

is a good place to get started.

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


Thread

Stupid question, just need a quick and dirty fix Jordan Bayless <jmbayless@gmail.com> - 2016-07-21 21:19 -0700
  Re: Stupid question, just need a quick and dirty fix Chris Angelico <rosuav@gmail.com> - 2016-07-22 14:28 +1000
    Re: Stupid question, just need a quick and dirty fix Jordan Bayless <jmbayless@gmail.com> - 2016-07-21 21:39 -0700
      Re: Stupid question, just need a quick and dirty fix Chris Angelico <rosuav@gmail.com> - 2016-07-22 14:45 +1000
        Re: Stupid question, just need a quick and dirty fix Jordan Bayless <jmbayless@gmail.com> - 2016-07-21 22:26 -0700
          Re: Stupid question, just need a quick and dirty fix Paul Rubin <no.email@nospam.invalid> - 2016-07-21 23:03 -0700
          Re: Stupid question, just need a quick and dirty fix Chris Angelico <rosuav@gmail.com> - 2016-07-22 16:34 +1000
          Re: Stupid question, just need a quick and dirty fix Steven D'Aprano <steve@pearwood.info> - 2016-07-22 16:37 +1000
            Re: Stupid question, just need a quick and dirty fix thilfigr16@gmail.com - 2016-07-22 06:00 -0700
          Re: Stupid question, just need a quick and dirty fix Cousin Stanley <cousinstanley@gmail.com> - 2016-07-22 08:45 -0700
      Re: Stupid question, just need a quick and dirty fix Michael Selik <michael.selik@gmail.com> - 2016-07-22 01:18 -0400
        Re: Stupid question, just need a quick and dirty fix Steven D'Aprano <steve@pearwood.info> - 2016-07-22 16:08 +1000
          Re: Stupid question, just need a quick and dirty fix Michael Selik <michael.selik@gmail.com> - 2016-07-22 18:53 +0000
  Re: Stupid question, just need a quick and dirty fix MRAB <python@mrabarnett.plus.com> - 2016-07-22 15:58 +0100

csiph-web