Re: python decimal library dmath.py v0.3 released

2014-03-04 Thread Mark H. Harris
python convention perhaps. Best regards, Mark H Harris -- https://mail.python.org/mailman/listinfo/python-list

Re: Geezer learns python

2014-03-04 Thread Mark H. Harris
On Tuesday, March 4, 2014 5:03:13 PM UTC-6, notbob wrote: {snip} hi notbob, Get a good book on python3 programming {Barnes and Noble, Amazon} and please, start with python (3). Great book: & fabulous tutorial: Summerfield, Mark. Programming in Python 3: A Complete Introduction to

Re: python decimal library dmath.py v0.3 released

2014-03-04 Thread Mark H. Harris
On Monday, March 3, 2014 7:46:38 PM UTC-6, Mark H. Harris wrote: > On Monday, March 3, 2014 5:34:30 AM UTC-6, Mark H. Harris wrote: > > > https://code.google.com/p/pythondecimallibrary/ > >https://pypi.python.org/pypi/pdeclib/0.3 Greetings, just a minor update here for v

Re: How security holes happen

2014-03-05 Thread Mark H. Harris
On Wednesday, March 5, 2014 2:26:12 AM UTC-6, Steven D'Aprano wrote: > On Wed, 05 Mar 2014 08:37:42 +0200, Marko Rauhamaa wrote: > > > If you had tried Python 30 years ago, you'd give it up for any serious > > work because it would be so slow and consume so much memory. > > /facepalm > > Python i

Re: How security holes happen

2014-03-05 Thread Mark H. Harris
On Wednesday, March 5, 2014 9:47:40 AM UTC-6, Steven D'Aprano wrote: > Seriously, Lisp is not only one of the oldest high-level languages > around, being almost as old as Fortran and Cobol, but it was one of the > biggest languages of the 1970s and even into the 80s. Lisp was specified by Joh

Re: How security holes happen

2014-03-05 Thread Mark H. Harris
On Wednesday, March 5, 2014 6:24:52 PM UTC-6, Dennis Lee Bieber wrote: > I must have had a deprived life... > > The only "debug" on a home system I ever used was the one in LS-DOS. > And even then, it was only because an OS update disk arrived with a bad > sector and could not be copie

test

2014-03-05 Thread Mark H. Harris
test please disregard -- https://mail.python.org/mailman/listinfo/python-list

Re: How security holes happen

2014-03-05 Thread Mark H. Harris
On Wednesday, March 5, 2014 7:40:05 PM UTC-6, MRAB wrote: > > The 6502 came from MOS Technology. Motorola made the 6800. Well, not exactly. The MOS 6502 is to the Motorola 6800 what the Zilog Z80 was to the Intel 8080. The same engineers who designed the 6800 moved out and then designed

Re: How security holes happen

2014-03-06 Thread Mark H. Harris
On Thursday, March 6, 2014 6:28:58 PM UTC-6, Dennis Lee Bieber wrote: > > The 6502 was NOT a Motorola chip (they had the 6800). The 6502 was MOS That's funny... did you not see what I wrote back to MRAB? Here: The MOS 6502 is to the Motorola 6800 what the Zilog Z80 was to the Intel 8080

test

2014-03-06 Thread Mark H. Harris
disregard -- https://mail.python.org/mailman/listinfo/python-list

Re: How security holes happen

2014-03-06 Thread Mark H. Harris
On Thursday, March 6, 2014 8:13:02 PM UTC-6, MRAB wrote: > > The Z80's architecture and instruction set is a superset of that of the > 8080; the 6502's architecture and instruction set isn't a superset of, > or even compatible with, that of the 6800 (although it can use the same > I/O, etc, chips)

Re: image processing in python and opencv

2014-03-10 Thread Mark H. Harris
On Sunday, March 9, 2014 2:09:25 PM UTC-5, Gary Herron wrote: > i have no idea how to retrieve indexed images stored in ordered dictionary, > using its values like : blue,green,red mean along with contrast, energy, > homogeneity and correlation. as i have calculated the euclidean distance and >

Sharing: File Reader Generator with & w/o Policy

2014-03-15 Thread Mark H Harris
else: line_count = 0 while True: linein = fh.readline() if (linein!=''): lineout = linein.strip('\n') length = len(lineout) yield((line_count, length, lineout)) line_count+=1

test

2014-03-15 Thread Mark H Harris
test -- https://mail.python.org/mailman/listinfo/python-list

Re: Sharing: File Reader Generator with & w/o Policy

2014-03-15 Thread Mark H Harris
On 3/15/14 4:56 PM, MRAB wrote: I don't like how it always swallows the exception, so you can't tell whether the file doesn't exist or exists but is empty, and no way to specify the file's encoding. Yes, the error handling needs more robustness/ and instead of printing the errcode, my actual m

Re: Sharing: File Reader Generator with & w/o Policy

2014-03-15 Thread Mark H Harris
On 3/15/14 4:56 PM, MRAB wrote: def fName(filename): try: with open(filename, 'r') as fh: for linein in fh: yield linein.strip('\n') except FileNotFoundError as err_code: print(err_code) [snip] The "with" confuses me because I am not sure s

Re: Sharing: File Reader Generator with & w/o Policy

2014-03-15 Thread Mark H Harris
On 3/15/14 4:56 PM, MRAB wrote: You can also shorten it somewhat: Thanks, I like it... I shortened the fnName() also: #- # fn2Name(filename) generator: file reader iterable #- de

Re: Sharing: File Reader Generator with & w/o Policy

2014-03-15 Thread Mark H Harris
On 3/15/14 8:32 PM, Mark Lawrence wrote: Start here http://docs.python.org/3/library/stdtypes.html#context-manager-types Thanks Mark. I have three books open, and that doc, and wading through. You might like to know (as an aside) that I'm done with gg. Got back up here with a real

Re: Sharing: File Reader Generator with & w/o Policy

2014-03-15 Thread Mark H Harris
On 3/15/14 9:01 PM, Steven D'Aprano wrote: Reading from files is already pretty simple. I would expect that it will be harder to learn the specific details of custom, specialised, file readers that *almost*, but not quite, do what you want, than to just write a couple of lines of code to do what

Re: test

2014-03-15 Thread Mark H Harris
On 3/15/14 8:48 PM, Travis Griggs wrote: On Mar 15, 2014, at 14:24, Mark H Harris wrote: test Pass Thanks Travis. I hated doing that. I have been having a fit with gg, and its taken just a little time to get a real news-reader client for posting. What a fit. Google does really well

Re: Sharing: File Reader Generator with & w/o Policy

2014-03-15 Thread Mark H Harris
On 3/15/14 10:48 PM, Chris Angelico wrote: There's a cost to refactoring. Suddenly there's a new primitive on the board - a new piece of language . . . Splitting out all sorts of things into generators when you could use well-known primitives like enumerate gets expensive fast {snip} [1] https:

Re: Sharing: File Reader Generator with & w/o Policy

2014-03-15 Thread Mark H Harris
On 3/16/14 12:41 AM, Chris Angelico wrote: Good stuff Chris, and thanks for the footnotes, I appreciate it. If getline() is doing nothing that the primitive doesn't, and getnumline is just enumerate, then they're not achieving anything beyond shielding you from the primitives. Yes.

Re: 'complex' function with string argument.

2014-03-17 Thread Mark H Harris
On 3/15/14 11:26 AM, Jayanth Koushik wrote: This is a very interesting philosophical question, one which I am surprised no one has answered; although, I think the reason for that might be entirely obvious. You actually answered your own question, as you were asking it. If the doc says "whate

Re: test

2014-03-17 Thread Mark H Harris
On 3/16/14 5:07 AM, Chris “Kwpolska” Warrick wrote: Why not use the mailing list instead? It’s a much easier way to access this place. I prefer to 'pull' rather than receive the 'push'. The newsreader idea is better because threading works better, and because the interface is simpler. I don't

Re: 'complex' function with string argument.

2014-03-17 Thread Mark H Harris
On 3/17/14 12:03 PM, Chris Angelico wrote: ast.dump(ast.parse("complex( 3 +2j )")) "Module(body=[Expr(value=Call(func=Name(id='complex', ctx=Load()), args=[BinOp(left=Num(n=3), op=Add(), right=Num(n=2j))], keywords=[], starargs=None, kwargs=None))])" The sole argument to complex() is an expr

Re: test

2014-03-17 Thread Mark H Harris
On 3/17/14 12:03 PM, Mark Lawrence wrote: Thunderbird and gmane, FWIW on Windows 7. I moved my news reader stuff like comp.lang.python over to my Thunderbird mail client yesterday; works well and is as functional as sea-monkey ever was. The client is nice and has none of the short-comings of

Re: 'complex' function with string argument.

2014-03-18 Thread Mark H Harris
On 3/17/14 11:52 PM, Steven D'Aprano wrote: On Mon, 17 Mar 2014 11:18:56 -0500, Mark H Harris wrote: Who knows, beats me. With respect, that's just because you would make a lousy language designer :-) Ouch;-) "How should one spell a complex number?" There is p

Re: Question about Source Control

2014-03-18 Thread Mark H Harris
On 3/17/14 8:06 AM, Frank Millman wrote: All my source code resides on an old Linux server, which I switch on in the morning and switch off at night, but otherwise hardly ever look at. It uses 'samba' to allow sharing with Windows, and 'nfs' to allow sharing with other Linux machines. hi Frank,

Re: running python 2 vs 3

2014-03-20 Thread Mark H Harris
On 3/20/14 9:58 AM, notbob wrote: I've installed python 3.3 on my Slack box, which by default comes with python 2.7. I know how to fire up the different IDLE environments, but how do I differentiate between the scripts? hi notbob, the two (or more) IDLE environments run very nicely side-by-s

Re: running python 2 vs 3

2014-03-20 Thread Mark H Harris
On 3/20/14 12:23 PM, notbob wrote: What the heck is a .pyc file and how are they created? Actually, I can see it's a compiled binary, but I where did it come from? The world according to me: python is an interpreter (vs compiler) which converts your source code into tokens and then into a

Re: running python 2 vs 3

2014-03-20 Thread Mark H Harris
On 3/20/14 12:47 PM, Marko Rauhamaa wrote: I've seen it done, but at least in those Python 2 days the pyc format changed between minor releases of Python, so Python itself had to be shipped with the pyc files. hi Marko, yeah, I have not done this; being that the concept is contrary to my princ

Re: running python 2 vs 3

2014-03-20 Thread Mark H Harris
On 3/20/14 2:53 PM, Alan Meyer wrote: #!/usr/bin/env python Only use the "python2" or "python3" versions if you really have a reason to do so. It gets tricky for distribution (you need docs for your distros, imho) because #!/usr/bin/env python means different things on different systems.

Re: running python 2 vs 3

2014-03-20 Thread Mark H Harris
, and opportunities for confusion. My goal for designing SimplyPy (for instance)is to present the beautiful heart of python (as Mark Summerfield calls it) and subsume the complexities of the fulness of python within a simple interface, BUT without limiting it. Python is easy enough to teach children (I&#x

Re: CallBack function in C Libraries.

2014-03-20 Thread Mark H Harris
On 3/20/14 6:16 PM, [email protected] wrote: def TheProc(c_int): fpgui.fpgFormWindowTitle(0, 'Boum') return 0 TheProcF = CMPFUNC(TheProc) Traceback (most recent call last): File "_ctypes/callbacks.c", line 314, in 'calling callback function' TypeError: TheProc() takes exactly 1 argument

Re: CallBack function in C Libraries.

2014-03-21 Thread Mark H Harris
On 3/21/14 7:02 AM, [email protected] wrote: Yep, Many thanks for help Hum, i have find the solution, it was in "CallBack function" in help-doc. No, it was not in the "CallBack function" in help-doc ... def TheProc(): <== you moved c_int from here ... f

Re: Implement multiprocessing without inheriting parent file handle

2014-03-21 Thread Mark H Harris
On 3/21/14 10:28 AM, Antony Joseph wrote: How can i implement multiprocessing without inherit file descriptors from my parent process? I'll bite... If what you mean by 'multiprocessing' is forking a process, to get a child process, which will then do some parallel processing for some reason,

Re: Implement multiprocessing without inheriting parent file handle

2014-03-21 Thread Mark H Harris
On 3/21/14 12:42 PM, Marko Rauhamaa wrote: http://docs.python.org/3/library/subprocess.html#popen-constructor> It's got the optional close_fds parameter, which is True by default. IOW, you don't need to do anything if you use subprocess.Popen() to start your child process. Incidentally,

Re: Installing ssdeep on Portable Python /advice

2014-03-21 Thread Mark H Harris
On 3/20/14 7:16 PM, [email protected] wrote: $ tar -zxvf ssdeep-2.10.tar.gz $ cd ssdeep-2.10&& ./configure&& make&& sudo make install I need install it on PortablePython for Windows, so it's not clear how to make this: where should be placed ssdeep Windows binary files, that Pyt

Re: Installing ssdeep on Portable Python /advice

2014-03-21 Thread Mark H Harris
On 3/21/14 9:51 PM, Mark H Harris wrote: On 3/20/14 7:16 PM, [email protected] wrote: $ tar -zxvf ssdeep-2.10.tar.gz $ cd ssdeep-2.10&& ./configure&& make&& sudo make install I need install it on PortablePython for Windows, so it's not clear how to make this:

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread Mark H Harris
On 3/21/14 5:44 PM, Mark Lawrence wrote: I'm pleased to see that you have answers. In return would you either use the mailing list 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 sp

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread Mark H Harris
On 3/21/14 11:15 PM, Chris Angelico wrote: It compounds. One reply makes for double spacing... two makes quadruple, three means we have seven wasted lines between every pair of real lines. That gets pretty annoying. And considering that most people who reply without cleaning up the lines also kee

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread Mark H Harris
On 3/21/14 11:30 PM, Mark H Harris wrote: All OS's should comply with the standard... for instance, there should not be a windows x'0a' x'0d' line ending, and a unix x'0d' line ending. whoops... I meant unix x'0a' line ending...;-)

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Mark H Harris
On 3/21/14 11:39 PM, Rustom Mody wrote: Given fl = [lambda y : x+y for x in [1,2,3]] It means: def rec(l): if not l: return [] else: x,ll = l[0],l[1:] return [lambda y: x + y] + rec(ll) followed by fl = rec([1,2,3]) Naturally a reasonable *implementation* would ca

Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary

2014-03-21 Thread Mark H Harris
On 3/21/14 11:46 PM, Chris Angelico wrote: (Side point: You have your 0d and your 0a backwards; the Unix line ending is U+000A, and the Windows default is U+000D U+000A.) Yeah, I know... smart apple. How are you going to make people change? What are you going to make them change to? Who co

Re: python installation on windows

2014-03-23 Thread Mark H Harris
On 3/23/14 4:07 PM, tad na wrote: On Sunday, March 23, 2014 12:33:02 PM UTC-5, tad na wrote: To set up a web browser: 1.open a dos window 2.navigate to dir you want "served" 3.type "python -m SimpleHTTPServer &." 4. open browser and type http://localhost:/ That is very ~cool. I learn

Re: loop

2014-03-23 Thread Mark H Harris
On 3/23/14 7:59 PM, anton wrote: for i in (10**p for p in range(3, 8)): print(i) Never do their home-work for them; but, in this case, what the heck. :) -- https://mail.python.org/mailman/listinfo/python-list

Re: Reading in cooked mode (was Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary)

2014-03-23 Thread Mark H Harris
On 3/23/14 10:17 PM, Chris Angelico wrote: Newline style IS relevant. You're saying that this will copy a file perfectly: out = open("out", "w") for line in open("in"): out.write(line) but it wouldn't if the iteration and write stripped and recreated newlines? Incorrect, because this versi

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-23 Thread Mark H Harris
On 3/22/14 4:46 AM, Steven D'Aprano wrote: On Fri, 21 Mar 2014 23:51:38 -0500, Mark H Harris wrote: Lambda is a problem, if only because it causes confusion. What's the problem? Glad you asked. The constructs DO NOT work the way most people would expect them to, having limited kn

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-24 Thread Mark H Harris
On 3/24/14 4:58 AM, Mark Lawrence wrote: Where do you get reduce from if it's not in the standard library? That was "a" proposal for 3000. Its there, but its not on the built-ins; ie., you have to import it. The confusion: why reduce, why not filter, nor map? {rhetor

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-24 Thread Mark H Harris
On 3/24/14 4:49 AM, Steven D'Aprano wrote: There's no doubt that lambda is less-often useful than is the def statement. But not only is it still useful, but there is a continual stream of people asking for Python to make it *more useful* by allowing the body of a lambda to be a full block, not ju

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-24 Thread Mark H Harris
On 3/24/14 4:03 AM, Ian Kelly wrote: The difference does not really lie in the lambda construct per se but in the binding style of closures. Functional languages tend to go one way here; imperative languages tend to go the other. {snip} The result may be more surprising to users accustomed to

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-24 Thread Mark H Harris
On 3/24/14 6:01 PM, Chris Angelico wrote: Easy fix. Use the "explicit capture" notation: adders[n] = lambda a, n=n: a+n And there you are, out of your difficulty at once! Yes, yes, yes, and example: adders= list(range(4)) for n in adders: >adders[n] = lambda a, n=n: a+n >

Re: Reading in cooked mode (was Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary)

2014-03-24 Thread Mark H Harris
On 3/24/14 6:30 PM, Dennis Lee Bieber wrote: {And I recall standard practice was to hit \r, to return the carriage, \n for next line, and one RUBOUT to provide a delay while the carriage returned to the left} Yes, yes... I remember well, there had to be a delay (of some type) to wait for the h

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-24 Thread Mark H Harris
On 3/24/14 5:43 PM, Marko Rauhamaa wrote: Mark H Harris: Yes, its about closures, totally; the most confusing aspect of lambda in python is not only the syntax but the idea of scope and closure (for that syntax). Everyone is confused by this initially, not because its complicated, but

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-24 Thread Mark H Harris
On 3/24/14 7:11 PM, Chris Angelico wrote: On Tue, Mar 25, 2014 at 10:56 AM, Mark H Harris wrote: What is needed is the explicit closure "grab" recommended by ChrisA. Which does work. You do know why, right? Sure. ... but again, that's not the point. The point is NOT can y

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-24 Thread Mark H Harris
On 3/24/14 7:32 PM, Mark Lawrence wrote: marcus I'd vote to have lambda taken out of the language if it meant avoiding tedious threads like this one :( Dude, you remind me of Eeyore; "days, weeks, months, who knows..." Its just a conversation. Don't setup a polling

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-24 Thread Mark H Harris
On 3/22/14 3:59 PM, vasudevram wrote: Thanks to all those who answered. - Vasudev I am wondering if the question was answered? x = [[1,2],[3,4],[5,6]] import ast ast.dump(ast.parse('[x for x in x for x in x]')) > "Module(body= > [Expr(value=ListComp(elt=Name(id='x', ctx=Load()), > g

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-24 Thread Mark H Harris
On 3/24/14 8:20 PM, Terry Reedy wrote: On 3/24/2014 7:56 PM, Mark H Harris wrote: the list which is used for each of the adder[] functions created. Wrong. Functions look up global and nonlocal names, such as n, when the function is called. hi Terry, yeah, I know; this is what's *

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Mark H Harris
On 3/24/14 10:00 PM, Rustom Mody wrote: About time we started using unicode in earnest dont you think?? Id like to see the following spellings corrected: lambda to λ great idea! {snip} [And now I hand it over to our very dear resident troll to explain the glories of the FSR] Now, that'

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Mark H Harris
On 3/24/14 10:17 PM, Chris Angelico wrote: On Tue, Mar 25, 2014 at 2:00 PM, Rustom Mody wrote: Yeah: Its 2014 (at least out here)... About time we started using unicode in earnest dont you think?? We do. Id like to see the following spellings corrected: lambda to λ in to ∈ (preferably with

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Mark H Harris
On 3/24/14 10:25 PM, Mark H Harris wrote: but, rats, can't find \ lambda Ok, there we go -> λ and ∈ and ∉ and ∀ no problem. -- https://mail.python.org/mailman/listinfo/python-list

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-24 Thread Mark H Harris
On 3/24/14 8:45 PM, Steven D'Aprano wrote: Your insistence that lambda is confusing is awfully condescending. People are not as dumb as you insist, and they are perfectly capable of learning lambda without a comp sci degree. Like any technical jargon, there is vocabulary and meaning to learn, bu

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Mark H Harris
On 3/24/14 10:51 PM, Chris Angelico wrote: Supporting both may look tempting, but you effectively create two ways of spelling the exact same thing; it'd be like C's trigraphs. Do you know what ??= is, This was a fit for me, back in the day IBM (system36 & system38). When we started supporting

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Mark H Harris
On 3/25/14 12:08 AM, Chris Angelico wrote: How quickly can you switch, type one letter (to generate one Cyrillic character), and switch back? ... very fast. Is not this nicer? >>> Π = pi >>> >>> sin(Π/4) 0.7071067811865475 >>> >>> cos(Π/4) 0.7071067811865476 >>> my pdeclib constants exte

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Mark H Harris
On 3/25/14 12:27 AM, Chris Angelico wrote: my pdeclib constants extension will have alternate spellings for Π and Γ and Δ and others... That's good! (Although typing Π quicker than pi is majorly pushing it. Well, I'll tell ya, its exactly the same--- two key-strokes, believe it or not.

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Mark H Harris
On 3/25/14 12:28 AM, Rustom Mody wrote: π = pi sin(π/4) 0.7071067811865475 cos(π/4) 0.7071067811865476 Looks better in emacs Input with tex mode -- 1 char to switch slightly verbose to type -- \pi gives π \Pi gives Π Whoohoo... yes, way more betterer/ :) -- https://mail.python.org/mailma

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Mark H Harris
On 3/25/14 12:42 AM, Rustom Mody wrote: You are not counting mouse For an emacs user Looking at mouse counts as 3 keystrokes ha! I would not be surprised that just "thinking" about the mouse might be worth 3 key-strokes for an emacs user! I use vi all the time; emacs less; depends on the

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Mark H Harris
On 3/25/14 12:48 AM, Chris Angelico wrote: Yup. Welcome to timezones. I'm UTC +11 here, although we'll drop back to +10 shortly as DST finishes (yay!). It's currently 0547 UTC, so you're presumably five hours behind UTC, which would put you east coast USA, most likely. (Especially since your mail

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Mark H Harris
On 3/25/14 12:48 AM, Chris Angelico wrote: (Especially since your mailer is putting the dates as mm/dd/yy, which is an abomination peculiar to Americans.) I did not know that; so is 25 Mar 2014 the preferred way? marcus -- https://mail.python.org/mailman/listinfo/python-list

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Mark H Harris
On 3/25/14 12:08 AM, Chris Angelico wrote: How quickly can you switch, type one letter (to generate one Cyrillic character), and switch back? Ok.. after installing Ukelete from Summer Institute of Linguistics SIL I can now edit the installed keymaps and select them from input sources at the t

Re: [newbie] confusion concerning fetching an element in a 2d-array

2014-03-25 Thread Mark H Harris
On 3/25/14 9:42 AM, Dave Angel wrote: All I need is a little python-example reading a file with e.g. three lines with three numbers per line and putting those numbers as floats in a 3x3-numpy_array, then selecting an element from that numpy_array using it's row and column-number. If your instr

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Mark H Harris
On 3/25/14 7:36 AM, Roy Smith wrote: (we're on one tiny planet, you know?) Speak for yourself. Are others on this list, um, on a different planet? Or, am I the only one who knows its tiny? Yes, we're on a tiny planet revolving around a speck of a star, at the edge of an insignificant

unicode as valid naming symbols

2014-03-25 Thread Mark H Harris
greetings, I would like to create a lamda as follows: √ = lambda n: sqrt(n) On my keyboard mapping the "problem" character is alt-v which produces the radical symbol. When trying to set the symbol as a name within the name-space gives a syntax error: >>> from math import sqrt >>> >>> √ = la

Re: unicode as valid naming symbols

2014-03-25 Thread Mark H Harris
On 3/25/14 1:52 PM, [email protected] wrote: '√'.isidentifier() > False 'λ'.isidentifier() > True > S.isidentifier() -> bool > > Return True if S is a valid identifier according > to the language definition. > > cf "unicode.org" doc Excellent, thanks! marcus -- https://mail.py

Re: unicode as valid naming symbols

2014-03-25 Thread Mark H Harris
On 3/25/14 2:24 PM, MRAB wrote: > It's explained in PEP 3131. > > Basically, a name should to start with a letter (this has been extended > to include Chinese characters, etc) or an underscore. > > λ is a classified as Lowercase_Letter. > > √ is classified as Math_Symbol. Thanks much! I'll no

Re: unicode as valid naming symbols

2014-03-27 Thread Mark H Harris
On 3/25/14 6:58 PM, Steven D'Aprano wrote: To quote a great Spaniard: “You keep using that word, I do not think it means what you think it means.” In~con~theveable ! My name is Inigo Montoya, you killed my father, prepare to die... Do you think that the ability to write

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-27 Thread Mark H Harris
On 3/26/14 1:35 AM, alex23 wrote: On 25/03/2014 12:39 PM, Mark H Harris wrote: my version semantically is "how it is perceived" by the user Could you please stop claiming to have insight into the comprehension of anyone other than yourself? Hasty generalisations don't help your

Re: unicode as valid naming symbols

2014-03-27 Thread Mark H Harris
On 3/27/14 10:51 AM, Rustom Mody wrote: Observe: Good ol infix -- x+y.. prefix (with paren) -- foo(x) prefix without -- ¬ x In case you thought alphanumerics had parens -- sin x Then theres postfix -- n! Inside fix -- nCr (Or if you prefer ⁿCᵣ ??) And outside fix -- mod -- |x| And Ive pro

Re: Reading in cooked mode (was Re: Python MSI not installing, log file showing name of a Viatnemese communist revolutionary)

2014-03-27 Thread Mark H Harris
On 3/25/14 6:38 PM, Dennis Lee Bieber wrote: A couple of us managed to "steal" the school login/password (don't think we ever used it, but...)... The teaching assistant didn't notice the paper tape punch was active when persuaded to login to let us run a short program (high school BASIC

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-27 Thread Mark H Harris
On 3/27/14 11:10 AM, Chris Angelico wrote: On Fri, Mar 28, 2014 at 2:44 AM, Mark H Harris wrote: My comments here are not in the least hasty, nor are they generalizations. They are based on long years of experience with "normal" users, {snip} Who is a "normal user"?

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-27 Thread Mark H Harris
On 3/27/14 11:48 AM, Chris Angelico wrote: On Fri, Mar 28, 2014 at 3:37 AM, Mark H Harris wrote: For the purposes of this list, a "normal" user is a reasonably intelligent college educated non "computer professional" non "computer scientist" non "expert&quo

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-27 Thread Mark H Harris
On 3/27/14 4:42 PM, Chris Angelico wrote: And this is the bit where, I think, we disagree. I think that programming is for programmers, in the same way that music is for musicians and the giving of legal advice is for lawyers. Yes, there are armchair lawyers, and plenty of people can pick up a hy

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-28 Thread Mark H Harris
On 3/27/14 7:34 PM, Steven D'Aprano wrote: > As for enormous number of users who will have > difficulty typing √ in their source code, they certainly don't count! > It's good enough that *you* have a solution to that problem, you can type > alt-v, and anyone who can't simply doesn't matter. You h

Howto flaten a list of lists was (Explanation of this Python language feature)

2014-03-28 Thread Mark H Harris
On Fri, Mar 21, 2014 at 1:42 PM, vasudevram wrote: >> Can anyone - maybe one of the Python language core team, or someone >> with knowledge of the internals of Python - can explain why this >> code works, and whether the different occurrences of the name x in >> the expression, are in differen

How to flatten a list of lists was (Explanation of this Python language feature?)

2014-03-28 Thread Mark H Harris
On 3/27/14 6:45 PM, Dan Stromberg wrote: On Fri, Mar 21, 2014 at 1:42 PM, vasudevram wrote: Can anyone - maybe one of the Python language core team, or someone with knowledge of the internals of Python - can explain why this code works, and whether the different occurrences of the name x in the

To flatten a nested list was (Explanation of this Python language feature? [x for x in x for x in x]

2014-03-28 Thread Mark H Harris
On 3/27/14 6:45 PM, Dan Stromberg wrote: x = [[1,2], [3,4], [5,6]] [x for x in x for x in x] I'll give this +1 for playfulness, and -2 for lack of clarity. I hope no one thinks this sort of thing is good to do in real-life code. You might try this to flatten a list of lists: >>> from

Re: Howto flaten a list of lists was (Explanation of this Python language feature)

2014-03-28 Thread Mark H Harris
On 3/28/14 5:12 PM, Mark Lawrence wrote: No. This has to be a better way to flatten lists: >>> from functools import reduce >>> import operator as λ >>> reduce(λ.add, l) [1, 2, 3, 4, 5, 6, 7, 8, 9] Why reinvent yet another way of flattening lists, particula

Re: Howto flaten a list of lists was (Explanation of this Python language feature)

2014-03-28 Thread Mark H Harris
On 3/28/14 9:33 PM, Steven D'Aprano wrote: Mark, please stop posting to the newsgroup comp.lang.python AND the mailing list [email protected]. They mirror each other. Your posts are not so important that we need to see everything twice. Its not my fault, Steven. Something goofy is

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-28 Thread Mark H Harris
On 3/28/14 9:45 PM, Chris Angelico wrote: On Sat, Mar 29, 2014 at 8:18 AM, Mark H Harris wrote: We have a unicode system [1] capable of zillions of characters, and most of [us] have some qwerty system keyboard [104 keys?] with meta key mappings for a few more. Talk about the cart before the

Re: To flatten a nested list was (Explanation of this Python language feature? [x for x in x for x in x]

2014-03-28 Thread Mark H Harris
On 3/28/14 9:31 PM, Steven D'Aprano wrote: On Fri, 28 Mar 2014 17:05:15 -0500, Mark H Harris wrote: >>> from functools import reduce >>> L = [[1,2,3],[4,5,6],[7],[8,9]] >>> import operator as λ >>> reduce(λ.add, L) [1, 2, 3, 4, 5,

Re: Howto flaten a list of lists was (Explanation of this Python language feature)

2014-03-28 Thread Mark H Harris
On 3/28/14 10:21 PM, Chris Angelico wrote: Well, something's causing your messages to come out multiple times and with different subject lines :) I changed the subject line ( which I did twice because the first post said it had an error and did not post; which apparently was a lie). Th

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-28 Thread Mark H Harris
On 3/28/14 10:51 PM, Steven D'Aprano wrote: Why must everyone in the world be stuck with a U.S. Royal typewriter keyboard for two or three hundred years? You are being patronising to the 94% of the world that is not from the USA. Do you honestly think that people all over the world have been u

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-28 Thread Mark H Harris
On 3/28/14 11:07 PM, Mark H Harris wrote: Think, virtual keyboard, on a keytoplayout... but separate from any touchable screen. And, think mac keytops (or flatter) not the plastic IBM typewriter like keyboards of today. Think beyond. What if~ when I select my UK standard keytop mappings (from

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-28 Thread Mark H Harris
On 3/28/14 11:16 PM, Mark H Harris wrote: I am able to type in Greek, well I've been doing it for about 12 years, but it would be s much better if the keytopsection actually morphed. What if, when you opened your new computer in Botswana, and you selected your language in gnu/linux

Re: Keyboard standards

2014-03-28 Thread Mark H Harris
On 3/28/14 11:18 PM, Ben Finney wrote: On the inexpensive end, Think Penguin will also happily ship Tux logo stickers to go on top of the Super key https://www.thinkpenguin.com/gnu-linux/tux-super-key-keyboard-sticker>. That's ~cool. I can now remove that nasty M$ meta key. Actually, I got so

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-28 Thread Mark H Harris
On 3/28/14 10:51 PM, Steven D'Aprano wrote: You are being patronising to the 94% of the world that is not from the USA. Do you honestly think that people all over the world have been using computers for 30 or 40 years without any way to enter their native language? uh, pretty much. That's why

Re: Keyboard standards

2014-03-28 Thread Mark H Harris
On 3/29/14 12:13 AM, Chris Angelico wrote: When I first met Windows keys, I just popped 'em off and left a gap. Worked fine. ha! see.. it popped you off too! :-)) I found it arrogant to the max to place their stupid logo on (my) keyboard. What if every company out there wanted "their" o

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-28 Thread Mark H Harris
On 3/29/14 12:08 AM, Chris Angelico wrote: Okay. History lesson time. Tell me what is the lingua franka today? Is it, E n g l i s h ? For many many many years people all over the earth were using English and ASCII to communicate with early computers... they still are. Almost e

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-29 Thread Mark H Harris
On 3/29/14 1:03 AM, Chris Angelico wrote: http://forum.ecomstation.ru/ Prominent discussion forum, although that strives to be at least partially bilingual in deference to those of us who are so backward as to speak only English. Yes. Well, as the joke goes, if you're trilingual you speak

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-29 Thread Mark H Harris
On 3/29/14 10:45 AM, Mark Lawrence wrote: On 29/03/2014 08:21, Mark H Harris wrote: Yes. Well, as the joke goes, if you're trilingual you speak three languages, if you're bilingual you speak two languages, if you're monolingual you're an American (well, that might

<    51   52   53   54   55   56   57   58   59   >