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

2016-07-22 Thread Michael Selik
On Fri, Jul 22, 2016 at 2:11 AM Steven D'Aprano wrote: > On Fri, 22 Jul 2016 03:18 pm, Michael Selik wrote: > >> On Jul 22, 2016, at 12:39 AM, Jordan Bayless > wrote: > >> > >> Posting the entire code snippet is tough because it's thousands of lines > >> of code. > > > > You could paste into a G

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

2016-07-22 Thread Cousin Stanley
Jordan Bayless wrote: > > 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 > On the outside chance that failing to define Id produces the Name error, I defined Id in a fo

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

2016-07-22 Thread MRAB
On 2016-07-22 05:19, Jordan Bayless wrote: I'm trying to modify some code to suit my purposes and I'm just trying to filter results as necessary. Basically, the code is returning one of a number from a subset of 150 numbers. I want to only do anything with it if the number is a 'good' one. I'm

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

2016-07-22 Thread thilfigr16
I'm certainly not going to sugar-coat it and act like I know anything about this language, or wax about how I think it's "inferior" for any reason (because doing so would be pretty foolish). I just figured I'd be able to muddle through and find *something* that would easily filter out results I

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

2016-07-21 Thread Steven D'Aprano
On Fri, 22 Jul 2016 03:26 pm, Jordan Bayless wrote: > No, I tried using a bunch of elif statements earlier and when I added more > than around 3 of them it threw errors. I just assumed that was some kind > of limit. Right, because a 20+ years old programming language used by millions of professi

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

2016-07-21 Thread Chris Angelico
On Fri, Jul 22, 2016 at 3:26 PM, Jordan Bayless wrote: > 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). You're still not posting (a) your code, or (b) the full traceback, so it's not easy for us

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

2016-07-21 Thread Steven D'Aprano
On Fri, 22 Jul 2016 03:18 pm, Michael Selik wrote: > >> On Jul 22, 2016, at 12:39 AM, Jordan Bayless wrote: >> >> Posting the entire code snippet is tough because it's thousands of lines >> of code. > > You could paste into a GitHub gist (https://gist.github.com/) and share > the link. Are yo

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

2016-07-21 Thread Paul Rubin
Jordan Bayless 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

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

2016-07-21 Thread Jordan Bayless
No, I tried using a bunch of elif statements earlier and when I added more than around 3 of them it threw errors. I just assumed that was some kind of limit. We both agree that's piss-poor, lazy coding. I'm just trying to find something that works though. To this point, everything I try fails.

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

2016-07-21 Thread Michael Selik
> On Jul 22, 2016, at 12:39 AM, Jordan Bayless wrote: > > Posting the entire code snippet is tough because it's thousands of lines of > code. You could paste into a GitHub gist (https://gist.github.com/) and share the link. -- https://mail.python.org/mailman/listinfo/python-list

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

2016-07-21 Thread Chris Angelico
On Fri, Jul 22, 2016 at 2:39 PM, Jordan Bayless wrote: > it seems there's a) no case statement (WTF?) and b) I'm limited to how many > elif statements I can use. The latter isn't true; and you're not using elif anyway. With no case statement, you get pushed to other, better ways of doing things,

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

2016-07-21 Thread Jordan Bayless
On Thursday, July 21, 2016 at 11:28:55 PM UTC-5, Chris Angelico wrote: > On Fri, Jul 22, 2016 at 2:19 PM, Jordan Bayless wrote: > > I get various errors no matter what I do to this to try and make it work. > > Variable not defined. Referenced before assignment. etc etc. I'm lost. How > > do I ma

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

2016-07-21 Thread Chris Angelico
On Fri, Jul 22, 2016 at 2:19 PM, Jordan Bayless wrote: > I get various errors no matter what I do to this to try and make it work. > Variable not defined. Referenced before assignment. etc etc. I'm lost. How do > I make it work? It might be easier if you post all your code. To be honest, what I

Stupid question, just need a quick and dirty fix

2016-07-21 Thread Jordan Bayless
I'm trying to modify some code to suit my purposes and I'm just trying to filter results as necessary. Basically, the code is returning one of a number from a subset of 150 numbers. I want to only do anything with it if the number is a 'good' one. I'm by no means a Python programmer (C# for me b