Re: (test) ? a:b

2014-10-23 Thread ast
48K? Luxury! ZX81 had an option for 64K -- https://mail.python.org/mailman/listinfo/python-list

Re: I am out of trial and error again Lists

2014-10-23 Thread Rustom Mody
On Thursday, October 23, 2014 10:33:57 PM UTC+5:30, Seymore4Head wrote: > On Thu, 23 Oct 2014 15:55:35 + (UTC), Denis McMahon wrote: > > >On Thu, 23 Oct 2014 10:04:56 -0400, Seymore4Head wrote: > > > >> On Thu, 23 Oct 2014 09:15:16 + (UTC), Denis McMahon wrote: > > > >>>Try the following 3

Re: I am out of trial and error again Lists

2014-10-23 Thread Chris Angelico
On Fri, Oct 24, 2014 at 2:14 PM, Terry Reedy wrote: > Example that works 'instantly' in 3.x, but would be slightly insane in 2.x, > even if you have enough memory for it to work on a 64 bit build. > r =range(0, 1000, 37) 3428761974385 in r > False 3428761974386 in r

Re: I am out of trial and error again Lists

2014-10-23 Thread Terry Reedy
On 10/23/2014 3:39 PM, Ian Kelly wrote: On Thu, Oct 23, 2014 at 11:07 AM, Seymore4Head wrote: BTW I forgot to add that example 2 and 3 don't seem to be too useful in Python 3, but they are in Python 2. I don't understand how the Python 3 is an improved version. In Python 2, range returns a l

Re: I am out of trial and error again Lists

2014-10-23 Thread Larry Hudson
On 10/23/2014 01:44 PM, Seymore4Head wrote: I tried to make range(10) work in Python 3 by: if int(y) in range(10): name.append(str(y)) It doesn't. That's true, it doesn't. However, did you actually READ the error message it gives? It has NOTHING to do with range().

Re: Truthiness

2014-10-23 Thread Steven D'Aprano
Ian Kelly wrote: > No, 3 is merely true, not True. True is just the name of a particular > singleton object that is also true. Sometimes I distinguish between "true" and "True", where True is the canonical boolean true object, but I prefer to refer to "true-like", "true-ish", or "truthy" objects

Re: FYI: Micro Python running on kickstarter pyBoard project, now shipping

2014-10-23 Thread Travis Griggs
> On Oct 23, 2014, at 2:11 PM, sohcahto...@gmail.com wrote: > > On Thursday, October 23, 2014 10:07:26 AM UTC-7, jkn wrote: >> Hi all >>I haven't heard in mentioned here, but since I saw one of the boards >> today thought I'd pass on the news: >> >> The Kickstarter 'MicroPython' project, wh

Re: FYI: Micro Python running on kickstarter pyBoard project, now shipping

2014-10-23 Thread sohcahtoa82
On Thursday, October 23, 2014 10:07:26 AM UTC-7, jkn wrote: > Hi all > I haven't heard in mentioned here, but since I saw one of the boards > today thought I'd pass on the news: > > The Kickstarter 'MicroPython' project, which has a tiny 'pyboard' (only a > couple of sq.inches in size) with

Re: I am out of trial and error again Lists

2014-10-23 Thread MRAB
On 2014-10-23 21:44, Seymore4Head wrote: [snip] I tried to make range(10) work in Python 3 by: if int(y) in range(10): name.append(str(y)) It doesn't. You didn't say what happened when you tried, but I can guess. When given, say, "g", it complains that it's not valid. W

Re: I am out of trial and error again Lists

2014-10-23 Thread Seymore4Head
On Thu, 23 Oct 2014 13:39:06 -0600, Ian Kelly wrote: >On Thu, Oct 23, 2014 at 11:07 AM, Seymore4Head > wrote: >> BTW I forgot to add that example 2 and 3 don't seem to be too useful >> in Python 3, but they are in Python 2. I don't understand how the >> Python 3 is an improved version. > >In Pyt

Re: I am out of trial and error again Lists

2014-10-23 Thread Seymore4Head
On Thu, 23 Oct 2014 13:39:06 -0600, Ian Kelly wrote: >On Thu, Oct 23, 2014 at 11:07 AM, Seymore4Head > wrote: >> BTW I forgot to add that example 2 and 3 don't seem to be too useful >> in Python 3, but they are in Python 2. I don't understand how the >> Python 3 is an improved version. > >In Pyt

Re: I am out of trial and error again Lists

2014-10-23 Thread Ian Kelly
On Thu, Oct 23, 2014 at 11:07 AM, Seymore4Head wrote: > BTW I forgot to add that example 2 and 3 don't seem to be too useful > in Python 3, but they are in Python 2. I don't understand how the > Python 3 is an improved version. In Python 2, range returns a list containing all the requested eleme

Re: OS X Menubar in Tkinter

2014-10-23 Thread Chris Angelico
On Fri, Oct 24, 2014 at 4:32 AM, Terry Reedy wrote: > I have asked on python-list-admin that the same info be sent to new gg > posters automatically and privately, or that the extra blanks be filtered > out, but to no avail. I don't think it's possible to auto-solve the Google Groups formatting i

Re: OS X Menubar in Tkinter

2014-10-23 Thread Terry Reedy
On 10/23/2014 9:25 AM, Kevin Walzer wrote: On 10/21/14, 1:58 AM, Mark Lawrence wrote: I'm pleased to see that you have an answer. In return would you please access this list via https://mail.python.org/mailman/listinfo/python-list or read and action this https://wiki.python.org/moin/GoogleGroup

FYI: Micro Python running on kickstarter pyBoard project, now shipping

2014-10-23 Thread jkn
Hi all I haven't heard in mentioned here, but since I saw one of the boards today thought I'd pass on the news: The Kickstarter 'MicroPython' project, which has a tiny 'pyboard' (only a couple of sq.inches in size) with a processor running 'a complete re-write of the Python (version 3.4) pr

Re: I am out of trial and error again Lists

2014-10-23 Thread Seymore4Head
On Thu, 23 Oct 2014 13:01:18 -0400, Seymore4Head wrote: >On Thu, 23 Oct 2014 15:55:35 + (UTC), Denis McMahon > wrote: > >>On Thu, 23 Oct 2014 10:04:56 -0400, Seymore4Head wrote: >> >>> On Thu, 23 Oct 2014 09:15:16 + (UTC), Denis McMahon >>> wrote: >> Try the following 3 commands at t

Re: I am out of trial and error again Lists

2014-10-23 Thread Seymore4Head
On Thu, 23 Oct 2014 15:55:35 + (UTC), Denis McMahon wrote: >On Thu, 23 Oct 2014 10:04:56 -0400, Seymore4Head wrote: > >> On Thu, 23 Oct 2014 09:15:16 + (UTC), Denis McMahon >> wrote: > >>>Try the following 3 commands at the console: > >You obviously didn't, so I'll try again. Try each of

Re: (test) ? a:b

2014-10-23 Thread Marko Rauhamaa
Alain Ketterlin : >> j = (lambda: 3, lambda: j + 1)[j < 10]() > > This is just a way to delay evaluation *of the potential results*, > i.e., instill a bit of lazyness. That's one way to characterize a function, or code in general. That point of view is apparent in PostScript, where control s

Re: Truthiness

2014-10-23 Thread Denis McMahon
On Thu, 23 Oct 2014 16:47:27 +0200, Alain Ketterlin wrote: > says: "In the context of Boolean operations, and also when expressions > are used by control flow statements, the following values are > interpreted as false: False, None, numeric zero of all types, and empty > strings and containers (in

Re: I am out of trial and error again Lists

2014-10-23 Thread Denis McMahon
On Thu, 23 Oct 2014 16:25:28 +0200, giacomo boffi wrote: > Rustom Mody writes: > >> [As best as I can make out the OP is not using the standalone >> interpreter nor idle nor (the many options like) >> python-interpreter-inside-emacs nor ipython nor ... > > but CodeSkulptor

Re: I am out of trial and error again Lists

2014-10-23 Thread Denis McMahon
On Thu, 23 Oct 2014 10:04:56 -0400, Seymore4Head wrote: > On Thu, 23 Oct 2014 09:15:16 + (UTC), Denis McMahon > wrote: >>Try the following 3 commands at the console: You obviously didn't, so I'll try again. Try each of the following three commands in the python console at the ">>>" prompt.

Re: I am out of trial and error again Lists

2014-10-23 Thread Rustom Mody
On Thursday, October 23, 2014 7:36:28 PM UTC+5:30, Seymore4Head wrote: > On Thu, 23 Oct 2014 06:42:43 -0700 (PDT), Rustom Mody wrote: > >[As best as I can make out the OP is not using the standalone > >interpreter > >nor idle > >nor (the many options like) python-interpreter-inside-emacs > >nor ipy

Re: Truthiness

2014-10-23 Thread random832
On Thu, Oct 23, 2014, at 10:56, Simon Kennedy wrote: > Thanks everyone. That's a thorough enough explanation for me. You should know, though, that numeric values equal to 1 (and 0 for False) _are_ == True. This works for dictionary keys, array indexes, etc. The bool type is actually a subclass of

Re: Truthiness

2014-10-23 Thread Wolfgang Maier
On 10/23/2014 04:47 PM, Alain Ketterlin wrote: Simon Kennedy writes: Just out of academic interest, is there somewhere in the Python docs where the following is explained? 3 == True False if 3: print("It's Twue") It's Twue i.e. in the if statement 3 is True but not in t

Re: Truthiness

2014-10-23 Thread Simon Kennedy
Thanks everyone. That's a thorough enough explanation for me. -- https://mail.python.org/mailman/listinfo/python-list

Re: I am out of trial and error again Lists

2014-10-23 Thread Tobiah
On 10/22/2014 01:30 PM, Seymore4Head wrote: def nametonumber(name): lst=[""] for x,y in enumerate (name): lst=lst.append(y) print (lst) return (lst) a=["1-800-getcharter"] print (nametonumber(a))#18004382427837 The syntax for when to use a () and when to use [] stil

Re: Truthiness

2014-10-23 Thread Skip Montanaro
On Thu, Oct 23, 2014 at 9:30 AM, Simon Kennedy wrote: > Just out of academic interest, is there somewhere in the Python docs where > the following is explained? Yes: https://docs.python.org/3/library/stdtypes.html#truth-value-testing https://docs.python.org/2.7/library/stdtypes.html#truth-valu

Re: Truthiness

2014-10-23 Thread Alain Ketterlin
Simon Kennedy writes: > Just out of academic interest, is there somewhere in the Python docs where > the following is explained? > 3 == True > False if 3: > print("It's Twue") > > It's Twue > > i.e. in the if statement 3 is True but not in the first https://docs.python.or

Re: I am out of trial and error again Lists

2014-10-23 Thread Seymore4Head
On Thu, 23 Oct 2014 16:40:22 +0200, giacomo boffi wrote: >Seymore4Head writes: > >> Because most of the practice I am getting is not using Python. I >> use Codeskulptor. > >Seymore, > >it's been months that you're struggling with python, if you happen to >own a computer could you please take th

Re: Truthiness

2014-10-23 Thread Wolfgang Maier
On 10/23/2014 04:30 PM, Simon Kennedy wrote: Just out of academic interest, is there somewhere in the Python docs where the following is explained? https://docs.python.org/3/library/stdtypes.html#truth-value-testing 3 == True False as opposed to: https://docs.python.org/3/library/stdtyp

Re: Truthiness

2014-10-23 Thread Ian Kelly
On Thu, Oct 23, 2014 at 8:30 AM, Simon Kennedy wrote: > Just out of academic interest, is there somewhere in the Python docs where > the following is explained? https://docs.python.org/3/reference/expressions.html#booleans 3 == True > False if 3: > print("It's Twue") > > It's

Re: I am out of trial and error again Lists

2014-10-23 Thread giacomo boffi
Seymore4Head writes: > Because most of the practice I am getting is not using Python. I > use Codeskulptor. Seymore, it's been months that you're struggling with python, if you happen to own a computer could you please take the time to install python on it and familiarise with the interactive

Re: (test) ? a:b

2014-10-23 Thread Alain Ketterlin
Marko Rauhamaa writes: > "BartC" : >>> x = [f, g][cond]() >> It will select f or g (which should refer to functions), and call one of >> those depending on cond. That's not a problem. >> >> The problem is it will still evaluate both f and g, > > That's not really the problem. The problem is in

Truthiness

2014-10-23 Thread Simon Kennedy
Just out of academic interest, is there somewhere in the Python docs where the following is explained? >>> 3 == True False >>> if 3: print("It's Twue") It's Twue i.e. in the if statement 3 is True but not in the first -- https://mail.python.org/mailman/listinfo/python-list

Re: I am out of trial and error again Lists

2014-10-23 Thread Seymore4Head
On Thu, 23 Oct 2014 16:25:28 +0200, giacomo boffi wrote: >Rustom Mody writes: > >> [As best as I can make out the OP is not using the standalone >> interpreter >> nor idle >> nor (the many options like) python-interpreter-inside-emacs >> nor ipython >> nor ... > >but CodeSkulptor

Re: I am out of trial and error again Lists

2014-10-23 Thread giacomo boffi
Rustom Mody writes: > [As best as I can make out the OP is not using the standalone > interpreter > nor idle > nor (the many options like) python-interpreter-inside-emacs > nor ipython > nor ... but CodeSkulptor ] CodeSkulptor has been mentioned recently by S4H, an

Re: (test) ? a:b

2014-10-23 Thread Ian Kelly
On Thu, Oct 23, 2014 at 7:44 AM, Marko Rauhamaa wrote: > However, the "[f, g][cond]()" technique is how pure lambda calculus > implements conditional branching so it is interesting in its own right. I wasn't aware that lambda calculus had lists and indexing built in. > IOW, you can do "short-cir

Re: I am out of trial and error again Lists

2014-10-23 Thread Seymore4Head
On Thu, 23 Oct 2014 08:20:32 +0100, Mark Lawrence wrote: >On 23/10/2014 02:57, Seymore4Head wrote: >> On Wed, 22 Oct 2014 21:35:19 -0400, Seymore4Head >> wrote: >> >>> On Thu, 23 Oct 2014 02:31:57 +0100, MRAB >>> wrote: >>> On 2014-10-23 01:10, Seymore4Head wrote: > On Thu, 23 Oct 2014

Re: I am out of trial and error again Lists

2014-10-23 Thread Seymore4Head
On Thu, 23 Oct 2014 09:15:16 + (UTC), Denis McMahon wrote: >On Wed, 22 Oct 2014 18:30:17 -0400, Seymore4Head wrote: > >> One more question. >> if y in str(range(10) >> Why doesn't that work. >> I commented it out and just did it "long hand" > >In the last post I made, I suggested to you the m

Re: I am out of trial and error again Lists

2014-10-23 Thread Seymore4Head
On Thu, 23 Oct 2014 06:42:43 -0700 (PDT), Rustom Mody wrote: >On Thursday, October 23, 2014 1:39:32 PM UTC+5:30, Mark Lawrence wrote: >> On 23/10/2014 08:56, Ian Kelly wrote: >> > On Thu, Oct 23, 2014 at 1:20 AM, Mark Lawrence wrote: >> >> If you were to read and digest what is written it would

Re: I am out of trial and error again Lists

2014-10-23 Thread Seymore4Head
On Thu, 23 Oct 2014 09:23:29 -0400, Dennis Lee Bieber wrote: >On Thu, 23 Oct 2014 00:10:28 -0700, Larry Hudson > declaimed the following: > > >>I know you are trying to explore lists here, but I found myself somewhat >>intrigued with the >>problem itself, so I wrote a different version. This v

Re: I am out of trial and error again Lists

2014-10-23 Thread Seymore4Head
On Thu, 23 Oct 2014 00:10:28 -0700, Larry Hudson wrote: >On 10/22/2014 03:30 PM, Seymore4Head wrote: >> On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head >> wrote: >> >> One more question. >> if y in str(range(10) >> Why doesn't that work. >> I commented it out and just did it "long hand" >> >> d

Re: (test) ? a:b

2014-10-23 Thread Marko Rauhamaa
"BartC" : >> Ah, but what would >> >> x = [f, g][cond]() >> >> produce? > > It will select f or g (which should refer to functions), and call one of > those depending on cond. That's not a problem. > > The problem is it will still evaluate both f and g, That's not really the problem. The problem

Re: I am out of trial and error again Lists

2014-10-23 Thread Rustom Mody
On Thursday, October 23, 2014 1:39:32 PM UTC+5:30, Mark Lawrence wrote: > On 23/10/2014 08:56, Ian Kelly wrote: > > On Thu, Oct 23, 2014 at 1:20 AM, Mark Lawrence wrote: > >> If you were to read and digest what is written it would help. You're > >> trying > >> to run IDLE. We're talking the int

Re: setuptools + data_files = 2

2014-10-23 Thread Simon Kennedy
On Wednesday, 22 October 2014 19:43:25 UTC+1, luc2 wrote: > hello, would you know how to make data_files work in setuptools ? > i can't figure out how to put datas in the generated .tar.gz If you're creating an sdist then you'll need to create a MANIFEST.in file in the same folder as setup.py wi

Re: OS X Menubar in Tkinter

2014-10-23 Thread Kevin Walzer
On 10/21/14, 1:58 AM, Mark Lawrence wrote: I'm pleased to see that you have an answer. In return would you please access this list via https://mail.python.org/mailman/listinfo/python-list or read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing double line spa

Re: (test) ? a:b

2014-10-23 Thread BartC
"Dennis Lee Bieber" wrote in message news:mailman.15097.1414022143.18130.python-l...@python.org... On Wed, 22 Oct 2014 19:08:40 +0100, "BartC" declaimed the following: Comparing: x = cond ? f() : g(); # C version with x = [f(), g()] [cond] (Should probably be x = [g(), f()] [cond]

Re: (test) ? a:b

2014-10-23 Thread MRAB
On 2014-10-23 04:46, Gregory Ewing wrote: Chris Angelico wrote: I've seen much MUCH worse... where multiple conditional expressions get combined arithmetically, and then the result used somewhere... In the days of old-school BASIC it was common to exploit the fact that boolean expressions eval

Re: I am out of trial and error again Lists

2014-10-23 Thread Denis McMahon
On Wed, 22 Oct 2014 19:11:51 -0400, Seymore4Head wrote: > On Wed, 22 Oct 2014 22:43:14 + (UTC), Denis McMahon > wrote: > >>On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head wrote: >> >>> def nametonumber(name): >>> lst=[""] >>> for x,y in enumerate (name): >>> lst=lst.append(y

Re: I am out of trial and error again Lists

2014-10-23 Thread Denis McMahon
On Wed, 22 Oct 2014 18:30:17 -0400, Seymore4Head wrote: > One more question. > if y in str(range(10) > Why doesn't that work. > I commented it out and just did it "long hand" In the last post I made, I suggested to you the mechanisms of using the python console and using code which prints out va

Re: I am out of trial and error again Lists

2014-10-23 Thread Mark Lawrence
On 23/10/2014 08:56, Ian Kelly wrote: On Thu, Oct 23, 2014 at 1:20 AM, Mark Lawrence wrote: If you were to read and digest what is written it would help. You're trying to run IDLE. We're talking the interactive interpreter. IDLE includes the interactive interpreter. If (at least on Wind

Re: I am out of trial and error again Lists

2014-10-23 Thread Ian Kelly
On Thu, Oct 23, 2014 at 1:20 AM, Mark Lawrence wrote: > If you were to read and digest what is written it would help. You're trying > to run IDLE. We're talking the interactive interpreter. IDLE includes the interactive interpreter. > If (at least on > Windows) you run a command prompt and th

Re: I am out of trial and error again Lists

2014-10-23 Thread Mark Lawrence
On 23/10/2014 02:57, Seymore4Head wrote: On Wed, 22 Oct 2014 21:35:19 -0400, Seymore4Head wrote: On Thu, 23 Oct 2014 02:31:57 +0100, MRAB wrote: On 2014-10-23 01:10, Seymore4Head wrote: On Thu, 23 Oct 2014 11:05:08 +1100, Steven D'Aprano wrote: Seymore4Head wrote: Those string errors

Re: I am out of trial and error again Lists

2014-10-23 Thread Larry Hudson
On 10/22/2014 03:30 PM, Seymore4Head wrote: On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head wrote: One more question. if y in str(range(10) Why doesn't that work. I commented it out and just did it "long hand" def nametonumber(name): lst=[] nx=[] for x in (name): lst.a